Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
how to get Column Count at runtime
posted

hi

 

how do  get column count after binding datasource

 

 

 

SqlConnection

 

cnn = new SqlConnection("Data Source=smaapc0103;Initial Catalog=Northwind;Integrated Security=True"

);

 

 

SqlDataAdapter adp = new SqlDataAdapter("SELECT TOP 10 * FROM Orders"

, cnn);

adp.Fill(ds);

ds.Tables[0].PrimaryKey =

 

new DataColumn[] { ds.Tables[0].Columns["OrderID"

] };

I am not able get column count at databinding event