System.Data.SqlClient.SqlCommandBuilder.RefreshSchema C# (CSharp) Method

RefreshSchema() private method

private RefreshSchema ( ) : void
return void
		public void RefreshSchema () 
		{
			tableName = String.Empty;
			dbSchemaTable = null;
		}

Usage Example

Exemplo n.º 1
0
 public static DataTable LogonUser(string userName,string password)
 {
     SqlConnection cn = null;
     try
     {
         cn = new SqlConnection(ConfigurationSettings.AppSettings["cn"]);
         cn.Open();
         userName = userName.Replace("'","''");
         password = password.Replace("'","''");
         SqlDataAdapter da = new SqlDataAdapter("SELECT KullaniciAdi, Sifre, KullaniciId, Adi_SoyAdi, Unvan, Email, Aciklama, DilId, CreDate, ModDate, IsOnay, IsAktif, ModUser, CreUser FROM tGuvKullanici where KullaniciAdi='"+ userName + "' and Sifre='"+ password + "'",cn);
         System.Data.DataSet ds = new DataSet();
         da.Fill(ds);
         SqlCommandBuilder builder = new SqlCommandBuilder(da);
         builder.RefreshSchema();
         return ds.Tables[0];
     }
     catch(Exception ex)
     {
         return new DataTable();
     }
     finally
     {
         if (cn!=null)
         {
             if (cn.State != ConnectionState.Closed)
                 cn.Close();
         }
     }
 }
All Usage Examples Of System.Data.SqlClient.SqlCommandBuilder::RefreshSchema