What is a strongly typed dataset?

Ans ;- A Dataset is an extremely flexibile method of accessing and manipulating data. A standard dataset provides a "late bound", collection based method of accessing and updating data. The type of data stored within the dataset is unknown at compile time and requires explicit casting and dynamic resolution at run-time. This is referred to as "weak typing".

The code below access the 'CustomerID' field in the 'Customers' table in a weakly typed dataset:-

string s = (string) myDataSet.Tables["Customers"].Rows[0]["CustomerID"];

The term "Strongly Typed" refers to the explicit naming and typing of methods and member variables of a class (in this case a dataset)

The code below access the 'CustomerID' field in the 'Customers' table in a strongly typed dataset:-

string s = myDataSet.Customers[0].CustomerID;

For more details on this, please go through link http://www.123aspx.com/redir.aspx?res=31913

No comments: