Difference between typed dataset and untyped dataset in .Net framework
Datasets can be typed or untyped.
A typed dataset is a dataset that is first derived from the base DataSet class and then uses information in an XML Schema file (an .xsd file) to generate a new class. Information from the schema (tables, columns, and so on) is generated and compiled into this new dataset class as a set of first-class objects and properties.
An untyped dataset, in contrast, has no corresponding built-in schema. As in a typed dataset,
an untyped dataset contains tables, columns, and so on — but those are exposed only as collections.
Typed DataSet
// C#
// This accesses the CustomerID column in the first row of
// the Customers table.
string s;
s = dsCustomersOrders1.Customers[0].CustomerID;
Untyped Datasets
// C#
string s = (string) dsCustomersOrders1.Tables["Customers"].Rows[0]["CustomerID"];
In addition to being easier to work with, the syntax for the typed dataset provides type checking at compile time, greatly reducing the possibility of errors in assigning values to dataset members.
Dotnet, DotnetCore, Azure, C#,VB.net, Sql Server, WCF, MVC ,Linq, Javascript and React.js
Showing posts with label Difference between typed dataset and untyped dataset in .Net framework. Show all posts
Showing posts with label Difference between typed dataset and untyped dataset in .Net framework. Show all posts
Subscribe to:
Posts (Atom)
Find number of letter occurence of all letter in c#
Find number of letter occurence of all letter in c# namespace ConsoleApp1 { internal class Program { static void Main(st...
-
ViewBag, ViewData, TempData and View State in MVC ASP.NET MVC offers us three options ViewData, ViewBag and TempData for passing data from...
-
View in Sql Server 2008 Creates a virtual table whose contents (columns and rows) are defined by a query. Use this statement to create a vie...
-
// Export Datatable to Excel in C# Windows application using System; using System.Data; using System.IO; using System.Windows.Forms; ...