EDN Admin
Well-known member
hi friends,
i have created a datatable as :
<div style="background-color:white; color:black
<pre>DataTable dt = <span style="color:blue new DataTable();
dt.Rows.Add( <span style="color:blue new <span style="color:blue object[] { <span style="color:#a31515 "1200", <span style="color:#a31515 "Rashid", <span style="color:#a31515 "Hamsa", <span style="color:#a31515 "Pimp" } );
dt.Rows.Add( <span style="color:blue new <span style="color:blue object[] { <span style="color:#a31515 "1300", <span style="color:#a31515 "Greg", <span style="color:#a31515 "Kilo", <span style="color:#a31515 "Spa" } );
dt.Rows.Add( <span style="color:blue new <span style="color:blue object[] { <span style="color:#a31515 "1400", <span style="color:#a31515 "Tilo", <span style="color:#a31515 "Hector", <span style="color:#a31515 "dolo" } );
[/code]
this throws the error: "Input array is longer than the number of columns in this table."
http://img824.imageshack.us/my.php?image=cannotbingdatatable.jpg" target="_blank <img src="http://img824.imageshack.us/img824/1971/cannotbingdatatable.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us
But shoudlnt create rows with defualt columns and column count is the length of the array?
thanks
View the full article
i have created a datatable as :
<div style="background-color:white; color:black
<pre>DataTable dt = <span style="color:blue new DataTable();
dt.Rows.Add( <span style="color:blue new <span style="color:blue object[] { <span style="color:#a31515 "1200", <span style="color:#a31515 "Rashid", <span style="color:#a31515 "Hamsa", <span style="color:#a31515 "Pimp" } );
dt.Rows.Add( <span style="color:blue new <span style="color:blue object[] { <span style="color:#a31515 "1300", <span style="color:#a31515 "Greg", <span style="color:#a31515 "Kilo", <span style="color:#a31515 "Spa" } );
dt.Rows.Add( <span style="color:blue new <span style="color:blue object[] { <span style="color:#a31515 "1400", <span style="color:#a31515 "Tilo", <span style="color:#a31515 "Hector", <span style="color:#a31515 "dolo" } );
[/code]
this throws the error: "Input array is longer than the number of columns in this table."
http://img824.imageshack.us/my.php?image=cannotbingdatatable.jpg" target="_blank <img src="http://img824.imageshack.us/img824/1971/cannotbingdatatable.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us
But shoudlnt create rows with defualt columns and column count is the length of the array?
thanks
View the full article