foreach(DataRow dro in DataTable.Rows){
string s = dro[ColumnIndex].ToString();
string s2 = dro["ColumnNameInQuotes"].ToString();//both yeild the same
result although the first way is much faster. If you want to sue
columnnames, use Bill Vaughn's method and create an enum where the
columnname corresponds to the index. Then you can effectively use the
"ColumnName" but get the efficiency of using the index.
//Also, I just casted to string, you'll need to adjust this to your needs
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.