Click here to Skip to main content
15,887,442 members
Home / Discussions / C#
   

C#

 
QuestionIs .net the future? Pin
Mri1a9-Aug-07 21:42
Mri1a9-Aug-07 21:42 
AnswerRe: Is .net the future? Pin
Pete O'Hanlon9-Aug-07 22:21
mvePete O'Hanlon9-Aug-07 22:21 
AnswerRe: Is .net the future? Pin
Talal Sultan9-Aug-07 22:31
Talal Sultan9-Aug-07 22:31 
GeneralRe: Is .net the future? Pin
J4amieC9-Aug-07 23:14
J4amieC9-Aug-07 23:14 
AnswerRe: Is .net the future? Pin
mav.northwind10-Aug-07 1:18
mav.northwind10-Aug-07 1:18 
GeneralRe: Is .net the future? Pin
Harkamal Singh12-Aug-07 6:45
Harkamal Singh12-Aug-07 6:45 
QuestionHow to store the retrieved values from a coulmn of a table in an array?? Pin
rameshbhojan9-Aug-07 21:41
rameshbhojan9-Aug-07 21:41 
AnswerRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Talal Sultan9-Aug-07 21:55
Talal Sultan9-Aug-07 21:55 
The SELECT command will already return the values in a table format. You need a data reader to loop through the values. You have to create your own DataTable (in this case with one column) and insert the values as you loop the data reader. If you are using SQL Server, you can use the SqlDataReader class.

Assuming you have:

sql command: SqlCommand myCommand = new SqlCommand();
data table: DataTable myTable = new DataTable();

You would have to put something like this

SqlDataReader dr = myCommand.ExecuteReader();

while (dr.Read()) // reads as long as there are values 
{
  DataRow row = myTable.NewRow();
  row[0] = dr.GetString(0); // to get the Name column
  row[1] = ...... // if you have other columns
  myTable.Rows.Add(row);
}
dr.Close();


Good luck Smile | :)

Talal


-- If this is a post that has been helpful to you, please vote for it. Thank you!

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook

GeneralRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Giorgi Dalakishvili9-Aug-07 22:03
mentorGiorgi Dalakishvili9-Aug-07 22:03 
GeneralRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
rameshbhojan10-Aug-07 0:42
rameshbhojan10-Aug-07 0:42 
AnswerRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Talal Sultan10-Aug-07 2:10
Talal Sultan10-Aug-07 2:10 
GeneralRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
rameshbhojan19-Aug-07 22:58
rameshbhojan19-Aug-07 22:58 
GeneralRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Talal Sultan19-Aug-07 23:21
Talal Sultan19-Aug-07 23:21 
AnswerRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Giorgi Dalakishvili9-Aug-07 21:56
mentorGiorgi Dalakishvili9-Aug-07 21:56 
GeneralRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
rameshbhojan19-Aug-07 21:19
rameshbhojan19-Aug-07 21:19 
GeneralRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Giorgi Dalakishvili19-Aug-07 21:22
mentorGiorgi Dalakishvili19-Aug-07 21:22 
AnswerRe: How to store the retrieved values from a coulmn of a table in an array?? Pin
Talal Sultan9-Aug-07 21:57
Talal Sultan9-Aug-07 21:57 
Questionlistview in c# Pin
monuSaini9-Aug-07 21:34
monuSaini9-Aug-07 21:34 
AnswerRe: listview in c# Pin
mav.northwind10-Aug-07 12:31
mav.northwind10-Aug-07 12:31 
AnswerRe: What to choose asp.net!!1 Pin
Albu Marius9-Aug-07 21:33
Albu Marius9-Aug-07 21:33 
GeneralRe: What to choose asp.net!!1 Pin
monuSaini9-Aug-07 23:23
monuSaini9-Aug-07 23:23 
QuestionCapturing Complete Webpage as an Image Pin
Dinesh N Samarathunga9-Aug-07 20:29
Dinesh N Samarathunga9-Aug-07 20:29 
AnswerRe: Capturing Complete Webpage as an Image Pin
Michael Sync9-Aug-07 20:35
Michael Sync9-Aug-07 20:35 
GeneralRe: Capturing Complete Webpage as an Image Pin
Dinesh N Samarathunga9-Aug-07 22:31
Dinesh N Samarathunga9-Aug-07 22:31 
AnswerRe: Capturing Complete Webpage as an Image Pin
Jax_qqq9-Aug-07 21:18
Jax_qqq9-Aug-07 21:18 

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.