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:
  1. Private Sub btnAddModel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAddModel.Click
  2.  
  3.         Dim qry As String
  4.         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")
  5.  
  6.         If TextBox1.Text <> "" Then
  7.             ModelListBox.Items.Add(TextBox1.Text)
  8.  
  9.             qry = "insert into models(model) values('" & TextBox1.Text & "')"
  10.  
  11.             Dim sqlcmd As New SqlCommand(qry, sqlcon)
  12.             sqlcon.Open()
  13.             sqlcmd.ExecuteNonQuery()
  14.             sqlcon.Close()
  15.             TextBox1.Clear()
  16.         Else
  17.             MsgBox("Please enter a Model in the above given box")
  18.         End If
  19.  
  20.     End Sub

Now I got stuck for deleting a particular row from database.

Any help and/or any corrections will be appreciated.

Trusted