Hello JMC,
Thank you for your response.
As I am very new to VS [ as you know that ], this is my first attempt for database, so bad me, I don't understand most of the things and terms.
But with the help of your above post, I did add using INSERT directly to the database, and it is working fine. My code is as follows:
vb Code:
Private Sub btnAddModel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddModel.Click Dim qry As String Dim sqlcon As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=D:\My Personal\VB Projects\Mobile Repairing\Mobile Repairing\repairs.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True") If TextBox1.Text <> "" Then ModelListBox.Items.Add(TextBox1.Text) qry = "insert into models(model) values('" & TextBox1.Text & "')" Dim sqlcmd As New SqlCommand(qry, sqlcon) sqlcon.Open() sqlcmd.ExecuteNonQuery() sqlcon.Close() TextBox1.Clear() Else MsgBox("Please enter a Model in the above given box") End If End Sub
Now I got stuck for deleting a particular row from database.
Any help and/or any corrections will be appreciated.
Trusted




and rate if you like this post
Reply With Quote