What is typed/untyped datasets ?
am 14.11.2007 15:38:08 von rachana
Hi,
I have understood Data Sets but what is meant by typed/untyped/
strongly typed datasets. Can any one explain me or suggest any site/
article, to get these concepts (and their comparisions) cleared?
Thanks,
Rachana
Re: What is typed/untyped datasets ?
am 14.11.2007 16:24:00 von sloan
A typed dataset is when you actually go in, and you setup a definition for
the dataset.
You do this with a "Add New DataSet".
You can do this. and call it the OrganizationDS
Then you actually can add a new table... and call it the "Employee" table.
Then you can add in columns to that table, like
EmployeeID (as int32)
LastName (as a string)
FirstName (as a string).
You can add in more tables as well. Like
"Department"
then add columns
DepartmentID (as int32)
DepartmentName (as string).
Now you have 2 tables.... in your "typed" dataset.
You can refer to them by NAME , instead of ordinal values.
OrganizationDS ds = new OrganizationDS();
ds.Employee.AddNewEmployeeRow ( 123 , "Smith", "John" )
ds.Department.AddNewDepartmentRow ( 1001, "Human Resources")
Console.Writeline ( ds.GetXml() ) ;
...
See how you're getting strong(typed) typing? You're adding rows via legit
methods.
If you go here:
http://sholliday.spaces.live.com/Blog/cns!A68482B9628A842A!1 39.entry
and download the code, I have a strong (typed) dataset being populated from
a stored procedure.
Mine is called the
CustomerOrderInfoDS
That's a VERY BRIEF introduction. But it will get you started, and you can
piggy back off of that intro to find more info.
Try to create the OrganizationDS ... for yourself in a new project. "Add
New Item" , "DataSet", name it "OrganizatonDS", and then use the Designer to
add in tables..then columns.
Depending on whether you're in 2.0 or 1.1 will depend on what you see via
the designer. So if you get stuck on that. tell us which version of VS200x
you have.
"Rachana" wrote in message
news:1195051088.945234.101700@s15g2000prm.googlegroups.com.. .
> Hi,
> I have understood Data Sets but what is meant by typed/untyped/
> strongly typed datasets. Can any one explain me or suggest any site/
> article, to get these concepts (and their comparisions) cleared?
> Thanks,
> Rachana
>