im in the middle of doing sql queries i can search my data base using
GetDateFrom (Select, from, where)

Me.nameTableAdapter.FillBy(namenDataSet.descip, Me.box1TextBox.Text, Me.box1TextBox.Text, Me.box2TextBox.Text, Me.box2TextBox.Text)

i have this working fine im struggling with inderting data to my databse i have made the query ..

INSERT INTO `details` (`Forename`, `Surname`, `Username`, `Password`)
 VALUES (''& ForenameTextBox.Text &'', ''& SunameTextBox.Text &'', ''& UsernameTextBox &'', ''& PasswordTextBox &'')

im not sure if this is right as when i call it it doesnt work i have this code for that..

Private Sub Save_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.nameTableAdapter.InsertQuery(nameDataSet.descrip, UsernameTextBox.Text, PasswordTextBox.Text, ForenameTextBox.Text, SurnameTextBox.Text)
    End Sub

im faced with an error saying my namedataset and descripdatatabe cannot be converted into a string

would like to know where im going wrong

Edited by __avd: Added [code] tags. For easy readability, always wrap programming code within posts in [code] (code blocks).

8 Years
Discussion Span
Last Post by IT21

Non-numeric field value must enclosed with ' (single quote).

INSERT INTO `details` (`Forename`, `Surname`, `Username`, `Password`)
 VALUES ('" & ForenameTextBox.Text & "', '" & SunameTextBox.Text & "', '" & UsernameTextBox & '", '" & PasswordTextBox & "')"

Edited by __avd: n/a


hey thanks for the help but i still think im doing something wrong as when i call the query im still getting the same error message that my data table cannot be converted into a string.
do i call the wuery just like i called the query in the select query?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.