What is typed/untyped datasets ?

R

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
 
S

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!139.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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top