Can someone tell me why I am getting:
Procedure or function AddRequestorInfo has too many arguments specified.
Here's my code. I'm trying to use two stored procedures. Do I have it set up properly?
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim question As String = Txtquestion.Text
Dim conn As New Data.SqlClient.SqlConnection("Data Source=seb2a54;Initial Catalog=EDCSFAQS;Persist Security Info=True;User ID=EDCSFAQUser;Password=fax") 'this is the conn from frontpage
'add string
Dim cmd As New Data.SqlClient.SqlCommand
With cmd
.Connection = conn 'the connection
.CommandType = Data.CommandType.StoredProcedure
.CommandText "AddQuestion"
.Parameters.AddWithValue("@topicid", CInt(DropDownList1.SelectedItem.Value))
.Parameters.AddWithValue("@quesdate", QuesDate.Text)
.Parameters.AddWithValue("@questions", Txtquestion.Text)
End With
'Dim cmd As New Data.SqlClient.SqlCommand
With cmd
'.Connection = conn
.CommandType = Data.CommandType.StoredProcedure
.CommandText = "AddRequestorInfo"
.Parameters.AddWithValue("@FName", FName.Text)
.Parameters.AddWithValue("@LName", LName.Text)
.Parameters.AddWithValue("@EmailAdd", EmailAdd.Text)
End With
'Try
conn.Open()
cmd.ExecuteNonQuery() 'executes the sql that I assign. don't need anything back from db
'Catch ex As Data.SqlClient.SqlException
'Throw New ApplicationException("An error occurred while trying to insert the record")
'Finally
conn.Close()
'End Try
End Sub
Procedure or function AddRequestorInfo has too many arguments specified.
Here's my code. I'm trying to use two stored procedures. Do I have it set up properly?
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim question As String = Txtquestion.Text
Dim conn As New Data.SqlClient.SqlConnection("Data Source=seb2a54;Initial Catalog=EDCSFAQS;Persist Security Info=True;User ID=EDCSFAQUser;Password=fax") 'this is the conn from frontpage
'add string
Dim cmd As New Data.SqlClient.SqlCommand
With cmd
.Connection = conn 'the connection
.CommandType = Data.CommandType.StoredProcedure
.CommandText "AddQuestion"
.Parameters.AddWithValue("@topicid", CInt(DropDownList1.SelectedItem.Value))
.Parameters.AddWithValue("@quesdate", QuesDate.Text)
.Parameters.AddWithValue("@questions", Txtquestion.Text)
End With
'Dim cmd As New Data.SqlClient.SqlCommand
With cmd
'.Connection = conn
.CommandType = Data.CommandType.StoredProcedure
.CommandText = "AddRequestorInfo"
.Parameters.AddWithValue("@FName", FName.Text)
.Parameters.AddWithValue("@LName", LName.Text)
.Parameters.AddWithValue("@EmailAdd", EmailAdd.Text)
End With
'Try
conn.Open()
cmd.ExecuteNonQuery() 'executes the sql that I assign. don't need anything back from db
'Catch ex As Data.SqlClient.SqlException
'Throw New ApplicationException("An error occurred while trying to insert the record")
'Finally
conn.Close()
'End Try
End Sub