By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,166 Members | 1,130 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,166 IT Pros & Developers. It's quick & easy.

what is meant by typed/untyped/strongly typed datasets?

P: n/a
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

Nov 14 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"Rachana" <mb*********@gmail.comschrieb
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

http://msdn2.microsoft.com/en-us/lib...zb(VS.80).aspx
Armin
Nov 14 '07 #2

P: n/a
On Nov 14, 3:08 pm, "Armin Zingler" <az.nos...@freenet.dewrote:
"Rachana" <mbs.rach...@gmail.comschrieb
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

http://msdn2.microsoft.com/en-us/lib...zb(VS.80).aspx

Armin
If something is strongly typed then it means you have explicitly told
the computer what kind of data you are working with. With untyped or
weakly typed languages or datasets, the system attempts to have a
guess.

For example. C# is strongly typed:

Int32 myvariable = 6; //myvariable is a number.
myvariable = "hello"; //error, you can't put a string in a number

however PHP is not:

$myvariable = 6; //myvariable is a number
$myvariable = "hello"; //myvariable is all of a sudden a string

The same thing applies to datasets with database programming. You can
apply the databases structure rigidly to your code or not.

Nov 14 '07 #3

P: n/a
Rachana,

One of the features from a dataset is that you can describe it in an XSD
file.

Visual Studio gives you a lot of possibilities to do that. As soon as you
have that XSD file you can make a class from it, that inherits the original
DataSet.

The trouble with the none strongly typed dataset is that you have yourself
to index all the tables, the columns and the items by integers, strings (and
columns for the items)

An object instanced from a Strongly Typed Dataset makes life much easier for
you.

Using a Row in a dataset means that you do
Dim myRow as DataRow = ds.Tables(0).NewRow

In a Strongly Typed dataset you do
Dim myRow as MyStronglyTypedDataset.NewMyTableRow

An item is then by instance in a non strongly typed dataset

myRow("ID")

in a strongly typed dataset it is
myRow.ID

This is much saver because the non strongly datasets give only errors on
runtime as you type something wrong. The strongly typed dataset does that at
design time.

Beside that are there properties around relations, and by instance is
nothing, and all with intelligence so you don't have to look all the time
what items you have to use and how to write them.

The trouble is with a strongly typed dataset is to get used to the names
that is generated from the XSD description for you (of course using the kind
of logic from the guys who made this class).

However as you are used to it you never want to use a non strongly dataset
anymore.

(This is all written in this message, normaly I use intelligence to get the
names, so I can have used some wrong)

Cor

Nov 14 '07 #4

P: n/a
I forgot to tell what Philip was telling however with C# samples.

The type gives that you don't have to cast the objects. In a non strongly
typed dataset everything is an object and therefore you are all the time
casting to the correct type.

However that is not the most important why I like it, because casting to the
receiver is easily done.

However this is of course done in advance for you in a Strongly Typed
Dataset.

Cor

Nov 14 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.