Well first off you have the second parameter of the Add Method containing the value you are passing in, and not the datatype. And you have not created any Parameter Objects , to store those parameter values for the SQL statement.
cmdSoftware.Parameters.Add("@SoftwareNum", Software.SoftwareNum)
should be
<strong>cmdSoftware.Parameters.Add("@SoftwareNum", SqlDataType.Int) </strong>
for example.
Values are not passed into the query with parameters like that, but rather it should be done like this:
<strong> Dim objNum as Parameter
objNum = </strong><strong>cmdSoftware.Parameters.Add("@SoftwareNum", SqlDataType.Int) </strong>
<strong> objNum.Value = Software.SoftwareNum</strong>
Remember: Add method is a for the Parameters Collection. It is a collection of Objects that hold the values which you want to pass to the SQL Statement. But no where in your code do you pass these collection of Parameter Objects the values you want them to contain. The Add method takes two Parameters (empty string, sql or odbc Datatype). Take a look at the Parameters Collection Class (a blueprint for a parameter object).
Hope this helps.
**Note : You should use msdn.microsoft.com to research the methods & parameters those methods take, when you are coding, and check out the Tutorials on Daniweb....may just help!. **
This may clarify, I changed the UPDATE statement to be more accurate, what you see before each parameter there is the actual column names, many in brackets b/c they would otherwise be illegal in VB code. (I didn't name the little buggers.) The error I get is still the same. Am I allowed to have slightly diff. param names than the corresponding column names?
Dim sUpdate As String = "UPDATE [SOFTWARE DATABASE] SET " _
& "[Software #]=@SoftwareNum, [Software Name]=@SoftwareName, Version=@Version, " _
& "Location=@Location, [Soft Brand]=@SoftwareBrand, DatePurchased=@DatePurchased, " _
& "FirstName=@FirstName, LastName=@LastName, SerialNumber=@SerialNumber, Model=@Model " _
& "WHERE SoftwareNum=@SoftwareNum"