hai
I want bind gridview , to all my database table name,
i having database name Authoriz and table name x,y,z......i want to bind all table names dynamically in run time,to my gridview.
iam using c#.net 2008,sql 2008 web application,
pls give c# coding urgent pls....
Loading
Mayur GujrathiPosted May 7, 2011, 4:39 AM
string sConn = "Data Source=(local);Network Library=DBMSSOCN;Initial Catalog=Northwind;User ID=sa;Password=stefan;";
string sSQL = "select * from table1;select * from table2";
DataSet ds = Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataset(sConn,
CommandType.Text, sSQL);
Mayur GujrathiPosted May 7, 2011, 4:34 AM
in dataset there can be more than one table so you can do this
i am not sure and also i havnt done this before
GridView1.DataSource = ds.Tables(0)
GridView1.DataBind()
GridView1.DataSource = ds.Tables(1)
GridView1.DataBind()
GridView1.DataSource = ds.Tables(2)
GridView1.DataBind()
and make proper arrangement of columns using template fields or as per your need