Error in My Add button SQL Server Management Studio And Visual Basic 2010

Posted by user2882523 on Stack Overflow See other posts from Stack Overflow or by user2882523
Published on 2013-10-18T14:13:46Z Indexed on 2013/10/18 15:55 UTC
Read the original article Hit count: 173

Filed under:
|

Here is the thing i cant use insert querry in my code there is an error in my sqlcommand that says the ExecuteNonQuery() not match with the values blah blah

here is my code

 Dim con As New SqlClient.SqlConnection("Server=.\SQLExpress;AttachDBFilename=C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\Finals.mdf;Database=Finals;Trusted_Connection=Yes;")
    Dim cmd As New SqlClient.SqlCommand
 cmd.Connection = con
        cmd.CommandText = "Insert Into [Finals].[dbo].[Nokia]  Values ('" & Unit.Text & "'),('" & Price.Text & " '),('" & Stack.Text & "'),('" & Processor.Text & "'),('" & Size.Text & "'),('" & RAM.Text & "'),('" & Internal.Text & "'),('" & ComboBox1.Text & "')"
        con.Open()
        cmd.ExecuteNonQuery()
        con.Close()
}

the problem is the cmd.CommandText can anyone pls help me

© Stack Overflow or respective owner

Related posts about sql

Related posts about visual-studio-2010