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

Answers were Sorted based on User's Feedback



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

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

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

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

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

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

Post New Answer

More ADO.NET Code Interview Questions

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?

1 Answers  


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

3 Answers   ABC, HCL, IBM,


Give me some tips in c#?

0 Answers  


How to connect c# visual studio 2008 to Oracle with ADO.NET? thanks for the answer.

1 Answers  


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

0 Answers  






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

0 Answers  


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

3 Answers   Satyam,


how to retrive file ,using file info on click event of a buton and disply it on a web form

1 Answers   Activa Softec,


Categories
  • ASP.NET Code Interview Questions ASP.NET Code (46)
  • VB.NET Code Interview Questions VB.NET Code (9)
  • C Sharp Code Interview Questions C Sharp Code (51)
  • ADO.NET Code Interview Questions ADO.NET Code (8)