how to connect bind a control to database by writing a
stored procedure?

Answer Posted / shivani

SqlConnection conn = new SqlConnection(strconn);
SqlCommand comm = new
SqlCommand"[StoreProcedureName]",conn);
comm.CommandType = CommandType.StoredProcedure;
comm.Parameters.AddWithValue("@UserId", Id);
sqldataadapter da= new sqldataadapter;
Dataset ds = new dataset;
try
{
conn.open();
da.fill(ds);
conn.fill;
}
catch
{
throw(ex);
}
dlFilldatalist.datasourse = ds;
dlFilldatalist.databind();

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to update and insert from datagridview at run time in excel database?

2759


Give me some tips in c#?

2160


How we work on N tire architecture in asp.net Please give me Examle...

16582


how to insert fname,lname,designation values into database while click on the submit button using windows authentication mode?

2195