Protected Sub btnAddSubmit_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnAddSubmit.Click Dim add As String
add = "INSERT INTO account(firstname, lastname, uname, pass, type)" & " VALUES ('" & fname.Text & "','" & lname & "','" & username & "','" & password & "','" & type & "')"
An error pops up at this part "INSERT INTO account(firstname, lastname, uname, pass, type)" & " VALUES ('" & fname.Text & "
The Error: Operator '&' is not defined for types 'String' and 'System.Web.UI.HtmlControls.HtmlInputText'.
The program that I have to create should have the ability to add an account can someone help me? :(
EDIT: I have manage to get it worked but however instead of recording the input in the textbox it shows System.Web.UI.HtmlControls.HtmlInputText in the database (instead of for example Firstname: Tom it shows Firstname: System.Web.UI.HtmlControls.HtmlInputText)
Dim SQLStatement As String = "INSERT INTO account(firstname, lastname, uname, pass, type)" & " VALUES ('" & fname.ToString() & "','" & lname.ToString() & "','" & username.ToString() & "','" & password.ToString() & "','" & type.ToString() & "')"
SaveNames(SQLStatement)
This is what I had change