3
Answers

Console Question

Photo of kevin

kevin

15y
1.9k
1

Need help with this:


Create a class Time with attributes: integers hour, min, sec (min and sec cannot have values bigger then 59). Write all basic methods, operator overloading function and all manipulating functions.


Can someone create this for me and upload it please.


That would be very much appreciated, :) :$

Thank you so much in advanced.

Answers (3)

0
Photo of Sandeep Singh Shekhawat
NA 22.4k 12m 12y
1. imports namesapce in class

using System.Data.SqlClient;

2. create a function in that class which retrun sqlConnection
public static SqlConnection Connection()
         {
            string connectionString = "Data Source=sandeepss-PC;database=Development;user=sa;password=knowdev";
            SqlConnection con = new SqlConnection();
            con.ConnectionString = connectionString;
            return con;
        }

3 create a function which return all login names in a data Table
 public static DataTable getUserLogin()
         {
             DataTable dt = new DataTable();
             SqlConnection con = Connection();
             SqlCommand cmd = new SqlCommand();
             cmd.CommandText = "select userLogin from tbl_login";
             cmd.Connection = con;
             con.Open();
             SqlDataReader reader = cmd.ExecuteReader();
             dt.Load(reader);
             return dt;
         }