hey
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

Recommended Answers

All 2 Replies

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

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

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.