none
Dataset connection RRS feed

All replies

  • string sqlAllCustomers = "SELECT * FROM Customers";
    string cnStr = 
     @"Data Source=.;Initial Catalog=northwind;Integrated Security=True";
    
    using (SqlConnection cn = new SqlConnection(cnStr))
    {
      cn.Open();
      SqlCommand cmd = new SqlCommand(sqlAllCustomers, cn);
      SqlDataAdapter adpt = new SqlDataAdapter(cmd);
      DataSet dsCust1 = new DataSet();
      adpt.Fill(dsCust1);
    }
    Friday, May 20, 2011 4:58 PM