I have this code that fills my datagrid with data:
I notice I'm using a dataset right? Then how am I suppose to fill my datagrid with data using a datatable? I've been very confused bout the topics in web like use a datatable or use a dataset bla bla bla...
VB.NET:
Dim connString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|\Network_Info.mdb"
Dim myConnection As OleDbConnection = New OleDbConnection
myConnection.ConnectionString = connString
' create a data adapter
Dim da As OleDbDataAdapter = New OleDbDataAdapter("Select DateRecorded As [Date Recorded], Format([TimeRecorded],'HH:MM:SS AM/PM') As [Time Recorded], Computer_Name As [Computer Name], Fastest_Download_Speed & ' Kb/s' As [Fastest Download Speed] , Fastest_Upload_Speed & ' Kb/s' As [Fastest Upload Speed], Average_Download_Speed & ' Kb/s' As [Average Download Speed], Average_Upload_Speed & ' Kb/s' As [Average Upload Speed], Total_Downloads & ' KB' As [Total Downloads], Total_Uploads & ' KB' As [Total Uploads], IP_Address, ElapsedTime As [Elapsed Time] from Computer_Connection_Info Order by DateRecorded, TimeRecorded", myConnection)
Dim ds As DataSet = New DataSet
da.Fill(ds, "Computer_Connection_Info")
DataGrid1.DataSource = ds.DefaultViewManager
I notice I'm using a dataset right? Then how am I suppose to fill my datagrid with data using a datatable? I've been very confused bout the topics in web like use a datatable or use a dataset bla bla bla...