Click here to Skip to main content
15,909,332 members
Home / Discussions / C#
   

C#

 
AnswerRe: Complex Question Pin
DaveyM6926-May-09 0:46
professionalDaveyM6926-May-09 0:46 
AnswerRe: Complex Question Pin
J4amieC26-May-09 1:10
J4amieC26-May-09 1:10 
GeneralRe: Complex Question Pin
Tom Deketelaere26-May-09 1:13
professionalTom Deketelaere26-May-09 1:13 
JokeRe: Complex Question Pin
0x3c026-May-09 1:30
0x3c026-May-09 1:30 
AnswerRe: Complex Question Pin
Dave Kreskowiak26-May-09 3:49
mveDave Kreskowiak26-May-09 3:49 
QuestionC# + Excel Pin
Socheat.Net25-May-09 22:52
Socheat.Net25-May-09 22:52 
AnswerRe: C# + Excel Pin
fly90425-May-09 23:02
fly90425-May-09 23:02 
GeneralRe: C# + Excel Pin
Socheat.Net25-May-09 23:10
Socheat.Net25-May-09 23:10 
Dear

I Use like this

string strCnn="";
strCnn = "Provider=Microsoft.Jet.OLEDB.4.0;";
strCnn += " Data source=" + openFileDialog1.FileName;
strCnn += ";Extended Properties=Excel 8.0;";
OleDbConnection cn = new OleDbConnection(strCnn);
cn.Open();
string strsql="";
strsql = "SELECT * FROM [sheet1$]";
OleDbDataAdapter da = new OleDbDataAdapter(strsql, cn);
DataTable dt = new DataTable();
da.Fill(dt);
int i=0;
Application.DoEvents();
for (int k = 0; k < dt.Rows.Count; k++)
{
i++;
dgvSource.Rows.Add(i.ToString(), dt.Rows[k][0].ToString());

}

I got only 9 rows, but in fact in excel has 10 rows

Thanks

     Socheat

GeneralRe: C# + Excel Pin
fly90425-May-09 23:26
fly90425-May-09 23:26 
GeneralRe: C# + Excel Pin
Socheat.Net25-May-09 23:30
Socheat.Net25-May-09 23:30 
GeneralRe: C# + Excel Pin
fly90425-May-09 23:34
fly90425-May-09 23:34 
GeneralRe: C# + Excel Pin
Socheat.Net26-May-09 15:33
Socheat.Net26-May-09 15:33 
QuestionHow to hide the black console window Pin
Rajdeep.NET is BACK25-May-09 22:31
Rajdeep.NET is BACK25-May-09 22:31 
AnswerRe: How to hide the black console window Pin
stancrm25-May-09 22:45
stancrm25-May-09 22:45 
AnswerRe: How to hide the black console window Pin
Tuwing.Sabado25-May-09 22:54
Tuwing.Sabado25-May-09 22:54 
GeneralRe: How to hide the black console window Pin
Rajdeep.NET is BACK25-May-09 23:32
Rajdeep.NET is BACK25-May-09 23:32 
AnswerRe: How to hide the black console window Pin
Pete O'Hanlon25-May-09 23:06
mvePete O'Hanlon25-May-09 23:06 
GeneralRe: How to hide the black console window Pin
Rajdeep.NET is BACK25-May-09 23:34
Rajdeep.NET is BACK25-May-09 23:34 
GeneralRe: How to hide the black console window Pin
EliottA26-May-09 2:48
EliottA26-May-09 2:48 
QuestionStore neutral date in database Pin
Casper Hansen25-May-09 21:33
Casper Hansen25-May-09 21:33 
AnswerRe: Store neutral date in database Pin
stancrm25-May-09 21:35
stancrm25-May-09 21:35 
GeneralRe: Store neutral date in database Pin
Casper Hansen25-May-09 21:41
Casper Hansen25-May-09 21:41 
GeneralRe: Store neutral date in database Pin
Eddy Vluggen25-May-09 21:55
professionalEddy Vluggen25-May-09 21:55 
Question[Message Deleted] Pin
vishal moharikar25-May-09 20:59
vishal moharikar25-May-09 20:59 
AnswerRe: Message Handling in C# Pin
stancrm25-May-09 21:13
stancrm25-May-09 21:13 

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.