Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

initialize a 2d array

Status
Not open for further replies.

jamert

Programmer
Dec 9, 2007
80
CA
Hi, and thanks, can a 2d array be initialized as such, in one line with a comma to let the array know the placeholder values?

SqlDataReader sdr...

if (sdr.HasRows)
{
while (sdr.Read()){

for (int i = 0; i <= 10; i++)
myarr.Add((string)("nam"+(i)),sdr["N"].ToString());
....
 
why load an array of objects instead of a strongly typed object? what you are trying to do is essentially create a light weight datatable/dataset. why not use those objects instead?

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top