Does AJAX can get ColumnName at client?
-
I want to get DataTable value by column index,not by specical column name,So I must get column name,I test many way to get it,it is always failed.this is my code. 1. alert(ds.Tables[0].Columns[0].Name); 2. alert(ds.Tables[0].Columns[0].Item[0]); 3. alert(ds.Tables[0].Columns[0].FieldName); 4. alert(ds.Tables[0].Columns[0].ColumnName); Can you help me?
-
I want to get DataTable value by column index,not by specical column name,So I must get column name,I test many way to get it,it is always failed.this is my code. 1. alert(ds.Tables[0].Columns[0].Name); 2. alert(ds.Tables[0].Columns[0].Item[0]); 3. alert(ds.Tables[0].Columns[0].FieldName); 4. alert(ds.Tables[0].Columns[0].ColumnName); Can you help me?
What was the error returned? ds.Tables[0].Columns[0].ColumnName should work unless your dataset is null or contains no tables, or the table has no columns at all. BTW, why are you using alert? If you mean to access the dataset from Javascript, you need to convert the dataset into either an XML or Javascript array first. "You are special, but so is everybody else." "Democracy is two wolves and a sheep voting on what to have for dinner" - Ross Edbert Sydney, Australia