title: vb write information from SQL Server database
body: <p>I use visual basic 2008 and a SQL Server database. I want to write the information stock in the database and I want to be rank like in php I use table to rank information what the method to do that in vb. This code write only last information into the table <code>tbl_cars</code></p>
  
  <pre><code>Dim da As SqlDataAdapter
  Dim dt As DataTable
  Dim sqlconn As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\m7md\Documents\Visual Studio 2008\Projects\Cars\Cars\cars.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True")
  dt = New DataTable
  da = New SqlDataAdapter
  Dim sql As String = ("select * from tbl_cars ")
  da = New SqlDataAdapter(sql, sqlconn)
  sqlconn.Open()
  da.Fill(dt)
  For Each drRow As DataRow In dt.Rows
      Label6.Text= (drRow.Item("db_type").ToString)
      Label7.Text = (drRow.Item("db_gender").ToString)
      Label8.Text = (drRow.Item("db_color").ToString)
      Label9.Text = (drRow.Item("db_price").ToString)
  
  Next
  End Sub
  </code></pre>