Hi im having a problem with the code,i'm not being able to figure out the problem..if anyone could help..thank you
Protected Sub btnActive_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnActive.Click
Dim connectionString As String = "Data Source = .\SQLEXPRESS; AttachDbFileName=|DataDirectory|Petite.mdf; Integrated Security=True; User Instance=True"
Dim conn As SqlConnection = New SqlConnection(connectionString)
Dim cmd As SqlCommand
Dim myupdate As String
myupdate = " UPDATE Seller Set Status='active' WHERE Username=@Username"
cmd = New SqlCommand(myupdate, conn)
cmd.Parameters.AddWithValue("@Username", Session("Username"))
conn.Open()
cmd.ExecuteNonQuery()
MsgBox("Account has been successfully activated!!")
Response.Redirect("AdminSellers.aspx")
conn.Close()
End Sub
And I'm getting this error
The parameterized query '(@username nvarchar(4000)) UPDATE Seller Set Status='deactivated' expects the parameter '@username', which was not supplied.