Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mary_itohan
Posting Yak Master
191 Posts |
Posted - 2007-05-28 : 06:44:49
|
Hi, am new to asp.net and trying to execute a stored proceedure, am excecuting it on the button click event, in the code below, is this correct ???Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cmd As New SqlCommand() cmd.Connection = conn cmd.CommandType = CommandType.StoredProcedure cmd.CommandText = "CustOrderHist" ' Create a SqlParameter for each parameter in the stored procedure. Dim customerIDParam As New SqlParameter("@customerID", "ALFKI") cmd.Parameters.Add(customerIDParam) End Sub Yes O ! |
|
mary_itohan
Posting Yak Master
191 Posts |
Posted - 2007-05-28 : 06:52:56
|
I mean is this a good practice, tried searching the internet but didnt see any examplesYes O ! |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-28 : 07:22:54
|
Yes. It is fine. But where is the execute statement for calling this SP? Like cmd.ExecuteNonQuery or cmd.ExecuteScalar, depending on the type of your SP?Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
|
|
|