Any idea why this code doesnt work? no errors
VB.NET:
SqlDataAdapter1.Update(DataSet11.GetChanges, "Users")
myConnection = New SqlConnection("uid=xxxxx;pwd=xxxxx;data source=LAPTOP\SQLEXPRESS;initial catalog=CheckWeigher")
'myCommand = New System.Data.SqlClient.SqlCommand("DELETE FROM Users WHERE (UserID, FirstName, LastName, Title, Password) = (@UserID, @FirstName, @LastName, @Title, @Password)", myConnection)
myCommand = New SqlCommand("DELETE FROM Users WHERE UserID = @UserID", myConnection)
myCommand.Parameters.Add("@UserID", Data.SqlDbType.NVarChar)
myCommand.Parameters.Item("@UserID").Value = TextBox2.Text
myCommand.Parameters.Add("@FirstName", Data.SqlDbType.NVarChar)
myCommand.Parameters.Item("@FirstName").Value = "bb" 'TextBox3.Text
myCommand.Parameters.Add("@LastName", Data.SqlDbType.NVarChar)
myCommand.Parameters.Item("@LastName").Value = "cc" 'TextBox4.Text
myCommand.Parameters.Add("@Title", Data.SqlDbType.NVarChar)
myCommand.Parameters.Item("@Title").Value = "dd" 'TextBox10.Text
myCommand.Parameters.Add("@Password", Data.SqlDbType.NVarChar)
myCommand.Parameters.Item("@Password").Value = "ee" 'TextBox5.Text
myConnection.Open()
myCommand.ExecuteNonQuery()
myConnection.Close()
Catch ex As Exception
End Try
Last edited: