developer155
Programmer
Hello I have a dataset and I am trying to find out how to get data from it using individual column name.
here is my code:
SqlConnection cn1 = new SqlConnection();
cn1.ConnectionString="Database=MyDB;User=sa;Password=pass;Server=SomeServ;";
cn1.Open();
SqlDataAdapter da = new SqlDataAdapter("Seelct * from Customers where customerid=111", cn1);
DataSet ds = new DataSet("DataSet");
da.Fill(ds,"DataSet");
So now I have this data from Customers table in dataset and I need to get single fields, like CustomerName, CustomerAddress
What is the way to do this?
thanks alot!!!!
here is my code:
SqlConnection cn1 = new SqlConnection();
cn1.ConnectionString="Database=MyDB;User=sa;Password=pass;Server=SomeServ;";
cn1.Open();
SqlDataAdapter da = new SqlDataAdapter("Seelct * from Customers where customerid=111", cn1);
DataSet ds = new DataSet("DataSet");
da.Fill(ds,"DataSet");
So now I have this data from Customers table in dataset and I need to get single fields, like CustomerName, CustomerAddress
What is the way to do this?
thanks alot!!!!