Click here to Skip to main content
15,914,165 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# 'static' variables on the web? Pin
S. Senthil Kumar18-May-05 7:24
S. Senthil Kumar18-May-05 7:24 
AnswerRe: C# 'static' variables on the web? Pin
S Sansanwal18-May-05 12:09
S Sansanwal18-May-05 12:09 
AnswerRe: C# 'static' variables on the web? Pin
Joshua Nussbaum18-May-05 14:21
Joshua Nussbaum18-May-05 14:21 
GeneralWebService DataSet Help Pin
Rougy18-May-05 5:29
Rougy18-May-05 5:29 
GeneralRe: WebService DataSet Help Pin
Robert Rohde18-May-05 8:40
Robert Rohde18-May-05 8:40 
GeneralRe: WebService DataSet Help Pin
Rougy19-May-05 4:10
Rougy19-May-05 4:10 
GeneralRe: WebService DataSet Help Pin
Rougy19-May-05 4:15
Rougy19-May-05 4:15 
GeneralRe: WebService DataSet Help Pin
Robert Rohde19-May-05 6:16
Robert Rohde19-May-05 6:16 
Ok. First of all one DataSet can consist of several tables which can be accessed (like you already did in your example) with the Tables property. You can also iterate through all tables with
foreach (DataTable dt in myDataSet.Tables) {
//Do something with dt
}

When you have one DataTable object you can then iterate through its rows:
foreach (DataRow dr in myDataTable.Rows) {
//Do something with the dr
}


You can access the vakues of each DataRow via its indexer which accepts either the index of the column you want to access or its name. You can also use the ItemArray property to retrieve all items in one array.
An example to just print out every value of every row of every table in a DataSet (what a sentence Smile | :) ) could be:

foreach (DataTable dt in myDataSet){
Console.WriteLine("Printing Table: " + dt.TableName);
foreach (DataRow dr in dt.Rows) {
Console.Write("Row: ");
object[] data = dr.ItemArray;
for (int i = 0; i < data.Length; i++) {
Console.Write(data[i].ToString());
}
Console.WriteLine("");
}
}

GeneralrichTextBox keyPress event problem Pin
pessen18-May-05 5:27
pessen18-May-05 5:27 
GeneralRe: richTextBox keyPress event problem Pin
S. Senthil Kumar18-May-05 5:42
S. Senthil Kumar18-May-05 5:42 
GeneralRe: richTextBox keyPress event problem Pin
pessen18-May-05 5:53
pessen18-May-05 5:53 
GeneralProblem in Opening connection in SQL Server Pin
Murtuza Husain Miyan Patel18-May-05 5:10
professionalMurtuza Husain Miyan Patel18-May-05 5:10 
GeneralRe: Problem in Opening connection in SQL Server Pin
Marc Clifton18-May-05 5:51
mvaMarc Clifton18-May-05 5:51 
GeneralRe: Problem in Opening connection in SQL Server Pin
Tom Larsen18-May-05 10:49
Tom Larsen18-May-05 10:49 
GeneralC# equivelant of Eval() Pin
JMichael246818-May-05 4:55
JMichael246818-May-05 4:55 
GeneralRe: C# equivelant of Eval() Pin
Marc Clifton18-May-05 5:47
mvaMarc Clifton18-May-05 5:47 
GeneralProblem in Uploading Files Pin
Anand for every one18-May-05 4:54
Anand for every one18-May-05 4:54 
Questionwhat does the keyword &quot;static&quot; mean? Pin
Sasuko18-May-05 4:43
Sasuko18-May-05 4:43 
AnswerRe: what does the keyword "static" mean? Pin
Tom Larsen18-May-05 4:53
Tom Larsen18-May-05 4:53 
AnswerRe: what does the keyword &quot;static&quot; mean? Pin
Peter Vertes18-May-05 5:09
Peter Vertes18-May-05 5:09 
GeneralRe: what does the keyword &quot;static&quot; mean? Pin
leppie18-May-05 9:34
leppie18-May-05 9:34 
Generalupdate particular attribute's value from xml file Pin
ksanju100018-May-05 4:23
ksanju100018-May-05 4:23 
QuestionArraylist bound to datagrid problem when arraylist is part of another class? Pin
spAAwn18-May-05 4:23
spAAwn18-May-05 4:23 
Generalreal challenge! How to implicitly override a Win form method Pin
jinzhecheng18-May-05 4:15
jinzhecheng18-May-05 4:15 
GeneralRe: real challenge! How to implicitly override a Win form method Pin
Marc Clifton18-May-05 4:21
mvaMarc Clifton18-May-05 4:21 

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.