How can you execute stored procedure from windows application?

Answer Posted / jigneshsanghvi


Stored proc. can be executed using command object by
ExecuteNonQuery method.

Sample Code :
Dim cnn as new sqlconnection
cnn.connectionstring=constr
cnn.open()

Dim cmd as new sqlcommand
cmd.connection=cnn
cmd.commandtext = "ProcName" & parameter list separated by comma
cmd.ExecuteNonQuery()

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the three parts of an http response?

730


Should I delete cookies?

752


Where session variables are stored?

759


What is the purpose of master page?

719


How can you pass multiple complex types in Web API?

788


explain code with multi inhertance

1856


What are the cookies types in asp.net?

769


What is caching? What are different ways of caching in asp.net?

935


Explain about ASP.NET?

845


Explain a program using razor view engine to create a simple application? : asp.net mvc

733


What is difference cookie and session?

764


I’m having some trouble with cas. How can I diagnose my problem?

824


Hi this is the coding for adding data in to an xml table i want the coding for update and delete Try Dim emp_xml_doc As New XmlDocument If System.IO.File.Exists(Server.MapPath("emp.xml")) Then emp_xml_doc.Load(Server.MapPath("emp.xml")) Dim myrow_element As XmlElement myrow_element = emp_xml_doc.CreateElement("EmpDetails") Dim str As String str = "" & TxtEmpId.Text & "" & _ "" & TxtName.Text & "" & _ "" & TxtSalary.Text & "" myrow_element.InnerXml = str emp_xml_doc.DocumentElement.AppendChild(myrow_element) emp_xml_doc.Save(Server.MapPath("emp.xml")) Response.Write("Record Saved") Dim ds As New DataSet ds.ReadXml(Server.MapPath("emp.xml")) GridView1.DataSource = ds GridView1.DataBind() Else Response.Write("File does not exist.") End If Catch ex As Exception Response.Write(ex.ToString) End Try *********************** this is the xml file 100 xxx 2000 yyy dddd 77777 rrrr rrrr 6666 qaqa sini 50000 errrrrrrrr rrrrrrrrr 677777 rrr rrr 33

1956


Define a static class?

735


Why do we need master page in asp.net?

729