F
friend
Hello all,
When I import the data from excel to datagridview in my project first
row is missing when displayed in the datagridivew
Excel data:
Field content 1234
10386524178 3434
31497645790 3434
61417861227 3434
21555680106 3434
66547895251 3434
7309310634 3434
6202733735 3434
50444214805 3434
after importing into datagridview:
Field content F1
10386524178 3434
31497645790 3434
61417861227 3434
21555680106 3434
66547895251 3434
7309310634 3434
6202733735 3434
50444214805 3434
if i write any string the first row then it gets displayed but if i
write any integer then it gets replaced by F1
Here is my code:
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection
("provider=Microsoft.Jet.OLEDB.4.0; data source= " & Table1.xls &
";Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter
("select * from [Tabelle1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "TestTable")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
How to resolve this...Thanks for any help
When I import the data from excel to datagridview in my project first
row is missing when displayed in the datagridivew
Excel data:
Field content 1234
10386524178 3434
31497645790 3434
61417861227 3434
21555680106 3434
66547895251 3434
7309310634 3434
6202733735 3434
50444214805 3434
after importing into datagridview:
Field content F1
10386524178 3434
31497645790 3434
61417861227 3434
21555680106 3434
66547895251 3434
7309310634 3434
6202733735 3434
50444214805 3434
if i write any string the first row then it gets displayed but if i
write any integer then it gets replaced by F1
Here is my code:
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection
("provider=Microsoft.Jet.OLEDB.4.0; data source= " & Table1.xls &
";Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter
("select * from [Tabelle1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "TestTable")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
How to resolve this...Thanks for any help