Looking for info on how to pass a variable (ie name) to a stored procedure.
Here is the stored procedure (@name the variable):
CREATE PROCEDURE dbo.NewSelectCommand_Test_1
@name text
AS
SET NOCOUNT ON;
SELECT au_id, au_lname, au_fname, phone, address, city, state, zip, contract FROM authors WHERE (au_lname like @name)
And here is the VB7 code calling the stored procedure which is done by SqlDataAdapter1, TextBox1.Text holds the variable to pass to the stored procedure:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = "Ringer"
DataSet31.Clear()
SqlDataAdapter1.Fill(DataSet31)
DataGrid1.DataBind()
End Sub
Can't seem to figure out how to pass the TextBox1.Text to the stored procedure.
TIA
Here is the stored procedure (@name the variable):
CREATE PROCEDURE dbo.NewSelectCommand_Test_1
@name text
AS
SET NOCOUNT ON;
SELECT au_id, au_lname, au_fname, phone, address, city, state, zip, contract FROM authors WHERE (au_lname like @name)
And here is the VB7 code calling the stored procedure which is done by SqlDataAdapter1, TextBox1.Text holds the variable to pass to the stored procedure:
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = "Ringer"
DataSet31.Clear()
SqlDataAdapter1.Fill(DataSet31)
DataGrid1.DataBind()
End Sub
Can't seem to figure out how to pass the TextBox1.Text to the stored procedure.
TIA