Example #1
0
 public static SqlConnection ConnectionData(Server ser,string mode,string username,string pass)
 {
     try
     {
         string cnStr = "";
         if (mode == "AUT")
         {
             cnStr = @"Server =" + ser.Server_name + @";Database = " + ser.Database_name + @"; Integrated Security = True; Asynchronous Processing = True";
             cn = new SqlConnection(cnStr);
             cn.Open();
             return cn;
         }
         else if (mode == "SQL")
         {
             cnStr = @"Server =" + ser.Server_name + @";Database = " + ser.Database_name + @"; User ID="+username+";Password="******";Trusted_Connection=False;";
             cn = new SqlConnection(cnStr);
             cn.Open();
             return cn;
         }
         return null;
     }
     catch (Exception)
     {
         throw;
     }
    
 }
Example #2
0
 public get_GUI()
 {
     sr = new Server();
     sr.Server_name = @"THANH\SQLEXPRESS";
     sr.Database_name = "POS";
     //cmd=new SqlCommand();
 }
Example #3
0
        public get_GUI()
        {
            sr = new Server();
            //sr.Server_name = @"THANH\SQLEXPRESS";
            //sr.Database_name = "POS";
            sr.Server_name = serverName;
            sr.Database_name = databaseName;
            sr.Mode = Mode;
            sr.UserName = UserName;
            sr.Password = Password;

            //cmd=new SqlCommand();
        }
Example #4
0
 public Test()
 {
     sr = new Server();
     sr.Server_name = @"VISKY_THANH\SQLEXPRESS";
     sr.Database_name = "test";
 }