Click here to Skip to main content
15,893,190 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to open a pdf File Pin
Arne Kuehn26-Jan-06 23:20
Arne Kuehn26-Jan-06 23:20 
QuestionShow Window Pin
jzb26-Jan-06 18:57
jzb26-Jan-06 18:57 
AnswerRe: Show Window Pin
James Gupta26-Jan-06 21:02
professionalJames Gupta26-Jan-06 21:02 
GeneralRe: Show Window Pin
jzb26-Jan-06 21:46
jzb26-Jan-06 21:46 
QuestionXML Serialization Pin
LighthouseJ26-Jan-06 18:40
LighthouseJ26-Jan-06 18:40 
AnswerRe: XML Serialization Pin
leppie26-Jan-06 21:30
leppie26-Jan-06 21:30 
GeneralRe: XML Serialization Pin
LighthouseJ27-Jan-06 5:41
LighthouseJ27-Jan-06 5:41 
QuestionWonder of DataGrid imort from Excel file Pin
Libra26-Jan-06 15:43
Libra26-Jan-06 15:43 
Has a Excel file like that:
         Title
Field1  Field2  Filed3
1        AA      1.1
2
3a      CC      3.3
4        DD      4.4
I wrote a program in order to import the excel file datas to DataGrid:
OleDbConnection connection = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Test.xls; Extended Properties=Excel 8.0");<br />
connection.Open();<br />
DataTable dt = new DataTable("Orders");<br />
OleDbDataAdapter da = new OleDbDataAdapter();<br />
da.SelectCommand = command;<br />
da.Fill(dt);<br />
this.dataGridTest.DataSource = dt;

Why in the DataGrid show as:
F1      Title   F2           ------> This is header
(null)  Field2  Filed3
1       AA      1.1
2       (null)  (null)
(null)  CC      3.3          ------> Note this line column 1 is null!
4       DD      4.4

If the Excel file like this:
         Title
Field1  Field2  Filed3
1       AA      1.1
2a
3a      CC      3.3
4a      DD      4.4
That the DataGrid turns to like this:
F1      Title    F2           ------> This is header
Field1  Field2  Filed3        ------> Note the Field1 now is not null
(null)  AA      1.1            ------> Note this line column 1 is null!
2a      (null)  (null)
3a      CC      3.3
4a      DD      4.4

Why? How can i prevent this result? (I had try to make the column 1 is Text format not Generic, but also yet)


=== Game is power! ===
AnswerRe: Wonder of DataGrid imort from Excel file Pin
Kodanda Pani26-Jan-06 20:36
Kodanda Pani26-Jan-06 20:36 
GeneralRe: Wonder of DataGrid imort from Excel file Pin
Libra27-Jan-06 16:21
Libra27-Jan-06 16:21 
QuestionRead and Replace Pin
picasso226-Jan-06 12:29
picasso226-Jan-06 12:29 
AnswerRe: Read and Replace Pin
Ravi Bhavnani26-Jan-06 12:42
professionalRavi Bhavnani26-Jan-06 12:42 
AnswerRe: Read and Replace Pin
DigitalKing26-Jan-06 14:30
DigitalKing26-Jan-06 14:30 
QuestionDisplay live video from an ethernet camera Pin
greg ross26-Jan-06 12:08
greg ross26-Jan-06 12:08 
AnswerRe: Display live video from an ethernet camera Pin
Daniel Santillanes26-Jan-06 13:00
professionalDaniel Santillanes26-Jan-06 13:00 
GeneralRe: Display live video from an ethernet camera Pin
greg ross31-Jan-06 3:18
greg ross31-Jan-06 3:18 
QuestionFun with generics Pin
tantiboh26-Jan-06 12:07
tantiboh26-Jan-06 12:07 
AnswerRe: Fun with generics Pin
Guffa26-Jan-06 12:27
Guffa26-Jan-06 12:27 
AnswerRe: Fun with generics Pin
Le centriste27-Jan-06 1:38
Le centriste27-Jan-06 1:38 
QuestionWindows refresh Pin
Kwai Cheng Kane26-Jan-06 9:43
Kwai Cheng Kane26-Jan-06 9:43 
AnswerRe: Windows refresh Pin
James Gupta26-Jan-06 10:21
professionalJames Gupta26-Jan-06 10:21 
GeneralRe: Windows refresh Pin
Kwai Cheng Kane26-Jan-06 10:28
Kwai Cheng Kane26-Jan-06 10:28 
GeneralRe: Windows refresh Pin
James Gupta26-Jan-06 10:58
professionalJames Gupta26-Jan-06 10:58 
Questionsystem tray Pin
mehrdadc4826-Jan-06 9:36
mehrdadc4826-Jan-06 9:36 
AnswerRe: system tray Pin
André Ziegler26-Jan-06 10:02
André Ziegler26-Jan-06 10:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.