Would you like to react to this message? Create an account in a few clicks or log in to continue.
For Questions and Assistance please use the proper Category.. please..
Welcome guys!!.. In order for you guys to post your Questions and assistance requests,, please REGISTER first.. Only members can post.. If you have requests then feel free to email ADMIN neuron or SPAMMER onatzky.. thanks!
Subject: Loading datagridview with data from SQL Tue Aug 14, 2012 9:50 am
THis is how you load your datagrid view with result from SQL
Code:
Private Sub loaddatagrid() Dim con As New OleDb.OleDbConnection Dim ds As New DataSet Dim da As OleDb.OleDbDataAdapter Dim sql As String Dim appath As String
appath = Application.StartupPath()
con.ConnectionString = "PROVIDER=Microsoft.jet.oledb.4.0;data Source = " & appath & "\SISdatabase.mdb" sql = "SELECT * FROM Item_Inventory" da = New OleDb.OleDbDataAdapter(sql, con) con.Open() da.Fill(ds, "SISdatabase")
DataGridView1.DataSource = ds.Tables(0) con.Close() End Sub