|
-
Nov 17th, 2003, 04:48 AM
#1
Thread Starter
New Member
How to.....pass a variable to a SP
Hello,
I just started to learn VB .NET.
I made a db program with sqlserver.
On form 1(name, address, aso) I have a searchbutton, by clicking on it a new form 2 with datagrid appears. I want to pass the value of one cell to a sp belonging to form 1 to fill this form.
I allready have this value, but now how to pass to a sp?? If I close this form I lost the value.
Can somebody help me or show me the way to do this.
Thanks in advance
Hans
-
Nov 18th, 2003, 11:06 AM
#2
Addicted Member
Clearly there are more options than this, but this is just a basic "off the top of my head" piece of code.
VB Code:
Dim cmd As New SqlClient.SqlCommand(strConnectionString)
Dim prm As New Parameter(strParamName, ParamValue)
cmd.Parameters.Add(prm)
cmd.ExecuteNonQuery(strSPName)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|