WelshyWizard
IS-IT--Management
Hi all,
I am using the following code to fill a datagrid with the contents of a csv file.
What I then want to do, after the user has made the relevant changes, is to press a button that will update a database with the information held in the datagrid.
I am not using a dataset so am a bit lost! Any help would be much appreciated.
Cheers.
Today is the tomorrow you worried about yesterday - and all is well.....
I am using the following code to fill a datagrid with the contents of a csv file.
Code:
If OpenFileDialog1.ShowDialog(Me) = DialogResult.OK Then
Dim fi As New FileInfo(OpenFileDialog1.FileName)
Dim sConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Extended Properties=Text;Data Source=" & fi.DirectoryName
Dim objConn As New OleDbConnection(sConnectionString)
objConn.Open()
Dim objCmdSelect As New OleDbCommand("SELECT * FROM " & fi.Name, objConn)
Dim objAdapter1 As New OleDbDataAdapter
objAdapter1.SelectCommand = objCmdSelect
Dim objDataset1 As New DataSet
objAdapter1.Fill(objDataset1, "test")
DataGrid1.DataSource = objDataset1.Tables(0).DefaultView
objConn.Close()
End If
What I then want to do, after the user has made the relevant changes, is to press a button that will update a database with the information held in the datagrid.
I am not using a dataset so am a bit lost! Any help would be much appreciated.
Cheers.
Today is the tomorrow you worried about yesterday - and all is well.....