Click here to Skip to main content
15,917,455 members
Home / Discussions / C#
   

C#

 
GeneralIcon Pin
Yulianto.6-Jan-08 16:18
Yulianto.6-Jan-08 16:18 
GeneralRe: Icon Pin
Judah Gabriel Himango6-Jan-08 16:41
sponsorJudah Gabriel Himango6-Jan-08 16:41 
GeneralRe: Icon Pin
MarkB7776-Jan-08 17:11
MarkB7776-Jan-08 17:11 
Generaldisplay sql data into excel .xls Pin
angels7776-Jan-08 15:01
angels7776-Jan-08 15:01 
GeneralRe: display sql data into excel .xls Pin
MarkB7776-Jan-08 17:10
MarkB7776-Jan-08 17:10 
GeneralRe: display sql data into excel .xls Pin
angels7776-Jan-08 17:52
angels7776-Jan-08 17:52 
GeneralRe: display sql data into excel .xls Pin
MarkB7776-Jan-08 21:39
MarkB7776-Jan-08 21:39 
GeneralRe: display sql data into excel .xls [modified] Pin
angels7777-Jan-08 5:01
angels7777-Jan-08 5:01 
cmd.Connection = con;
cmd.CommandText = "select * from contact";
da.SelectCommand = cmd;
DataTable dtable = new DataTable();
DataSet ds2 = new DataSet();

da.Fill(ds2);
dtable = ds2.Tables[0];

// Create an array to multiple values at once.
string[,] saNames = new string[5, 2];

saNames[0, 0] = dtable.Rows[0].ItemArray[1].ToString();
saNames[0, 1] = dtable.Rows[0].ItemArray[2].ToString();
saNames[1, 0] = dtable.Rows[0].ItemArray[3].ToString();
saNames[1, 1] = dtable.Rows[0].ItemArray[4].ToString();
saNames[2, 0] = dtable.Rows[0].ItemArray[5].ToString();
saNames[2, 1] = dtable.Rows[0].ItemArray[6].ToString();
saNames[3, 0] = dtable.Rows[0].ItemArray[7].ToString();
saNames[3, 1] = dtable.Rows[0].ItemArray[8].ToString();
saNames[4, 0] = dtable.Rows[0].ItemArray[9].ToString();
saNames[4, 1] = dtable.Rows[0].ItemArray[10].ToString();


the above is based on one row data..
how if my database has many rows of data ??
i want to put a while loop there.

also the saNames[0, 0] ..saNames[4, 1].. data which exported arrange weird.. not fooolow the sequence..

modified on Monday, January 07, 2008 11:34:08 PM

QuestionDelete cookies Pin
SilverV6-Jan-08 9:56
SilverV6-Jan-08 9:56 
GeneralRe: Delete cookies Pin
Luc Pattyn6-Jan-08 10:25
sitebuilderLuc Pattyn6-Jan-08 10:25 
AnswerRe: Delete cookies Pin
SilverV6-Jan-08 10:44
SilverV6-Jan-08 10:44 
GeneralRe: Delete cookies Pin
Luc Pattyn6-Jan-08 10:48
sitebuilderLuc Pattyn6-Jan-08 10:48 
QuestionHow to run program that i made in VS2008 in Win 2000 ? Pin
E_Gold6-Jan-08 8:56
E_Gold6-Jan-08 8:56 
AnswerRe: How to run program that i made in VS2008 in Win 2000 ? [modified] Pin
Scott Dorman6-Jan-08 9:35
professionalScott Dorman6-Jan-08 9:35 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Paul Conrad6-Jan-08 9:36
professionalPaul Conrad6-Jan-08 9:36 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Scott Dorman6-Jan-08 9:47
professionalScott Dorman6-Jan-08 9:47 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Paul Conrad6-Jan-08 9:51
professionalPaul Conrad6-Jan-08 9:51 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
E_Gold6-Jan-08 9:47
E_Gold6-Jan-08 9:47 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Scott Dorman6-Jan-08 9:50
professionalScott Dorman6-Jan-08 9:50 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Paul Conrad6-Jan-08 9:53
professionalPaul Conrad6-Jan-08 9:53 
AnswerRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Kevin McFarlane6-Jan-08 10:55
Kevin McFarlane6-Jan-08 10:55 
GeneralRe: How to run program that i made in VS2008 in Win 2000 ? Pin
Scott Dorman6-Jan-08 12:26
professionalScott Dorman6-Jan-08 12:26 
Questionhow to disply menuitem Pin
angels7776-Jan-08 6:58
angels7776-Jan-08 6:58 
AnswerRe: how to disply menuitem Pin
Paul Conrad6-Jan-08 9:39
professionalPaul Conrad6-Jan-08 9:39 
GeneralRe: how to disply menuitem Pin
angels7776-Jan-08 17:50
angels7776-Jan-08 17:50 

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.