i have this insert code and its giving errors because there is something wrong with the connection string.
Dim MyConnection As SqlConnection
Dim SqlString As String = "INSERT INTO items_table (item) VALUES ('" & Me.txtItem.Text & "')"
'Dim data_base As String = " Data Source=.\SQLEXPRESS;AttachDbFilename="C:\vb2008\Visual Studio 2008\Projects\morevariables\morevariables\App_Data\test_db.mdf";Integrated Security=True;User Instance=True"
Dim data_base As String = " C:\vb2008\Visual Studio 2008\Projects\morevariables\morevariables\App_Data\test_db.mdf";Integrated Security=True;User Instance=True"
MyConnection = New SqlConnection("Data Source=" & data_base)
Dim concom As SqlCommand = MyConnection.CreateCommand()
MyConnection.Open()
Dim cmnd As SqlCommand = New SqlCommand(SqlString, MyConnection)
cmnd.ExecuteNonQuery() ' Execute the command here
MyConnection.Close()