mgmhicks
asked on
Cant add paramenter to data adapter
I have a data adapter I am trying to associate parameters to so I can run an da.update(ds) statement. Here is my code.
Keeps dealing me I need the new keyword. Could someone help me out.
thanks in advance.
Dim myCMD As New SqlCommand
myCMD.Connection = myConn
myCMD.CommandText = "TAG_UpdateSQFT"
myCMD.CommandType = CommandType.StoredProcedure
Dim param1 As New SqlParameter("@SQFT", SqlDbType.NVarChar, 10, "SQFT")
Dim param2 As New SqlParameter("@ID", SqlDbType.Int, 10, "ID")
myDA.UpdateCommand.Parameters.Add(New SqlParameter(param1))
myDA.UpdateCommand.Parameters.Add(param2)
myDA.UpdateCommand = myCMD
Keeps dealing me I need the new keyword. Could someone help me out.
thanks in advance.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Or change the "myDA.UpdateCommand" in lines 7 and 8 to "myCMD".
ASKER
thank you