You can also create a (strongly typed) dataset. And get strong typing.
Start a new Console Application:
Add / New Item / DataSet.
Call it "EmployeeDS". (or EmployeeDS.xsd)
Right click (in the design area) ... Add a table. "Employee"
Add 3 columns
ID (int)
LastName (string)
FirstName (string)
...
then you can "code up" a version like this
EmployeeDS ds = new EmployeeDS();
//first way
ds.Employee.AddNewEmployeeRow ( 123, "Smith" , "John");
//second way
EmployeeDS.Employee.EmployeeRow newRow = ds.Employee.NewEmployeeRow();
newRow.ID = 234;
newRow.LastName = "Jones";
newRow.FirstName = "Mary";
ds.Employee.AddNewEmployeeRow ( newRow ) ;
string x = ds.GetXml();
I do that all the time for UnitTests, and testing code without talking to
the database.
Good luck.
"forest demon" <me********@gmail.comwrote in message
news:f1**********************************@u10g2000 prn.googlegroups.com...
what i'm trying to do is attach a report file to a reportviewer
instance with some values from a page. i can attach a dataset to
the .rdlc file with stuff from a datasource, but i need to also add
values form a pages web controls to the same report.
it was recommended, on here, that i create a dataset in memory and add
that to the report. i'm not sure how to do that at this point without
a datasource. i'm drawing a blank.
thanks to all who reply....
-
fd