Binding the database to the datagrid while loading the page

Y

yasodhai

Hi,
I have to bind the database to the datagrid control.

string secid=Session["SID"].ToString();
int sid=Convert.ToInt32(secid);

//Adding the records in the Fielddet table to the datagrid
string Fld = "select * from fielddet where sectionID=@SecID";
SqlCommand FldCmd= new SqlCommand(Fld,myConnection);
SqlParameter secIDParameter= new
SqlParameter("@SecID",SqlDbType.Int,4);

secIDParameter.Value=sid;
FldCmd.Parameters.Add(secIDParameter);
DataSet Fldds=new DataSet();

Without using where clause it is possible for me to bind the database
with the grid. Kindly help me how to fill the datagrid using this
datasource.


Thanks & Regards,
Yasodhai
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top