Hi,
Thanks for replying. What I did eventually was to create an object called row:
DataRow row = ds.Tables["AA"].NewRow();
row.aa = row.retrieveStudentResults2(intX, intY, "aa");
row.bb = row.retrieveStudentResults2(intX, intY, "bb");
ds.Tables["AA"].Rows.Add(new Object[] {row.aa, row.bb,row. cc, ..... });
The issue I am worried about is that this means that I have to make multiple
connections to the db just to populate my ds. I wonder if there is a more
efficient way of doing this.
This seems to work though.
regards,
andrew
"VHD50" wrote:
> Suppose you know the data (how many columns there are & which data goes into
> which column...), you can manually build a datarow, then add it to the
> datatable. Some thing like this:
> DataRow row = ds.Tables["AA"].NewRow();
> row.Item(0) = x
> row.Item(1) = y
> row.Item(2) = z
> ....
> ds.Tables["AA"].Rows.Add(row);
>
> Hope this helps.
> VHD50.
>
>
>
>
> "Andrew" wrote:
>
> > Hi,
> >
> > Thanks for the reply. Actually my table structure doesn't allow me to use
> > the BETWEEN statement. The sqlstatement that I have given is just an example
> > of me requiring a loop to add a new row to the datatable.
> >
> > Is there anyone else here who can help me out ?
> > Thanks.
> >
> > regards,
> > andrew
> >
|