I know this is an old post, but I hope someone can help me. I am getting the error "has too many arguments specified" for a stored procedure that I call, but only after the first time I call it. The first time it works fine. I reduced my number of arguments to four for testing and checked all the code. I am using vb6.net and a clsSQLDatabase that I have used successfully before. Here is my code:
Dim WithEvents lobj As New clsSQLDatabase
Try
lobj.ConnectionString = ConnectionString
lobj.OpenDBConnection()
lobj.BuildNewSQLCommand("UpdateMostWantedParents42 1")
lobj.AddParameterToSQLCommand(SqlDbType.Int, "@id", curID, ParameterDirection.Input)
lobj.AddParameterToSQLCommand(SqlDbType.Char, "@LastName", txtLName.Text, ParameterDirection.Input)
lobj.AddParameterToSQLCommand(SqlDbType.Char, "@FirstName", txtFName.Text, ParameterDirection.Input)
lobj.AddParameterToSQLCommand(SqlDbType.Char, "@MName", txtMiddle.Text, ParameterDirection.Input)
lobj.ExecuteStoredProcedure()
Catch ex As Exception
Label1.Text = ex.ToString
End Try
It seems as if I need to clear out the object lobj or something. Any ideas?
Thanks,
Linda
|