I'm new to Ajax. I've returned a dataset from a C# method and I'm
trying to figure out how to loop through the dataset to get the
results.
The only thing I see on the net is an example to get the row/column
count:
var cols = dt.value.Tables[0].Columns.length;
var rows = dt.value.Tables[0].Rows.length;
But how do you loop through the dataset? I'm trying to fill a dropdown
html select with the results.
This is where I'm at (looping through the first row).
for(var i=0; i<dt.value.Tables[0].Rows.length; i++) {
document.form1.ddSelect.options[i] = new
Option(dt.value.Tables[0].Rows[i][dt.value.Tables[0].Columns[i].Name],i);
}
}
Thanks,
Shawn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ajax.NET Professional" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/ajaxpro
The latest downloads of Ajax.NET Professional can be found at
http://www.ajaxpro.info/
Don't forget to read my blog at http://weblogs.asp.net/mschwarz/
The open source project is now located at
http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxPro
-~----------~----~----~----~------~----~------~--~---