how to connect bind a control to database by writing a
stored procedure?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / badrinath
dim con as sqlconncetion
dim cmd as sqlcommand
dim parm as sqlparameter
con=new sqlconnection
("server=localhost;database=Database1;username=sa;password=s
a")
cmd=new sqlcommand
con.open()
cmd.commandtype=commandtype.storedprocedure
cmd.commandtext="StoredprocedureName"
cmd.parmaeters.add("@Name",txtname.txt)
cmd.parameters.add("@sal",txtname.txt)
cmd.excutenonquery()
con.close()
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / badrinath
dim con as sqlconncetion
dim cmd as sqlcommand
dim parm as sqlparameter
con=new sqlconnection
("server=localhost;database=Database1;username=sa;password=s
a")
cmd=new sqlcommand
con.open()
cmd.commandtype=commandtype.storedprocedure
cmd.commandtext="StoredprocedureName"
cmd.parmaeters.add("@Name",txtname.txt)
cmd.parameters.add("@sal",txtname.txt)
cmd.excutenonquery()
con.close()
Is This Answer Correct ? | 2 Yes | 1 No |
How to connect c# visual studio 2008 to Oracle with ADO.NET? thanks for the answer.
How to update and insert from datagridview at run time in excel database?
How we work on N tire architecture in asp.net Please give me Examle...
how to retrive file ,using file info on click event of a buton and disply it on a web form
how to connect bind a control to database by writing a stored procedure?
how to insert fname,lname,designation values into database while click on the submit button using windows authentication mode?
In the Design view in Visual Studio 2005 of an ASP.NET web page, what is the easiest way to create an event handler for the default event of an ASP.NET server control?
Give me some tips in c#?