Monday, April 28, 2008

Bind Data with dataset

SqlConnection con=new SqlConnection("user id=sa;password=;database=northwind;data source=compaq12");
SqlDataAdapter da=new SqlDataAdapter("select * from orders order by "+ str,con);
DataSet ds=new DataSet();
da.Fill(ds,"orders");
DataGrid1.DataSource=ds.Tables["orders"];
DataGrid1.DataBind();

No comments:

Loading...