|
Hello,
I'm new to ado.net. Here is the code which i use to declare the dataTable:
DataTable dtable = new DataTable("dtable");
dtable.Columns.Add("SID",typeof(System.String));
dtable.Columns.Add("givenName", typeof(System.String));
dtable.Columns.Add("sn", typeof(System.String));
dtable.Columns.Add("mail", typeof(System.String));
dtable.Columns.Add("tel", typeof(System.String));
dtable.Columns.Add("mobile", typeof(System.String));
dtable.Columns.Add("office", typeof(System.String));
and here is the code for adding a new row.
for (int i = 0; i <src.Count - 1; i++)
{
DataRow tempRow = dtable.NewRow();
tempRow.ItemArray[0] = SID[ i ];
tempRow.ItemArray[1] = givenName[ i];
tempRow.ItemArray[2] = sn[ i];
tempRow.ItemArray[3] = mail[ i];
tempRow.ItemArray[4] = tel[ i];
tempRow.ItemArray[5] = mobile[ i];
tempRow.ItemArray[ 6] = office[ i];
dtable.Rows.Add(tempRow);
}
dtable.AcceptChanges();
but somehow when i'm trying to display the item using response.write it doesn't give me anything. I have checked the SN is bringing the records.
Solution?
Prince of Dhump |