There are loads of ways.
Here is the most basic.
Retrieve info:
Using con As New SqlConnection(strConnect)
con.Open()
Using com As New SqlCommand("SELECT iD, description FROM myTable", con)
Using reader As SqlDataReader = com.ExecuteReader()
While reader.Read()
Dim id__1 As Integer = CInt(reader("iD"))
Dim desc As String = DirectCast(reader("description"), String)
Console.WriteLine("ID: {0}" & vbLf & " {1}", iD, desc)
End While
End Using
End Using
End Using
Insert new rows:
Using con As New SqlConnection(strConnect)
con.Open()
Using com As New SqlCommand("INSERT INTO myTable (myColumn1, myColumn2) VALUES (@C1, @C2)", con)
com.Parameters.AddWithValue("@C1", myValueForColumn1)
com.Parameters.AddWithValue("@C2", myValueForColumn2)
com.ExecuteNonQuery()
End Using
End Using