hi,
ich lese aus einer tabelle im dataset die spaltennamen und
m�chte sie gern in ein stringarray speichern.
etwa so:
string[] colnamen;
private void Page_Load()
{
DataColumnCollection cols;
cols = dataSet11.Tables[this.tabname].Columns;
int index=0;
foreach(DataColumn col in cols)
{
this.colnamen[index]=col.ColumnName;
index++;
}
}
das geht aber nicht wegen:
"Object reference not set to an instance of an object."
wenn ich statt
string[] colnamen; string[] colnamen={};
schreibe,kommt:
"Index was outside the bounds of the array."
wie geht'n das richtig???
mfg rob
| [aspdedotnet] als [email protected] subscribed
| http://www.dotnetgerman.com/archiv/aspdedotnet/ = Listenarchiv
| Sie k�nnen sich unter folgender URL an- und abmelden:
| http://www.dotnetgerman.com/listen/aspDEdotnet.asp