.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Typed DataSets in .NET

Posted By: Venkat     Posted Date: March 02, 2010    Points: 2   Category :ADO.Net
we can specify the data type when we create a DataColumn for a DataTable. This is to enforce the runtime type-safety for the column so that only data of specified data type can be stored in the column

View Complete Post

More Related Resource Links

Data Points: Efficient Coding With Strongly Typed DataSets


Someone once said to me that the hallmark of a good developer is the desire to spend time efficiently. Developers are continually pursuing ways to make coding easier and faster, and to reduce the number of errors.

John Papa

MSDN Magazine December 2004

Typed DataSets/Connection Pooling


 Hey all,

I've got an ASP.net application that has about 100-120 sites connecting to punch in/out in the beg of shift, lunch, and end of shift. I've found that the app gets slow/non-responsive during peak times. Also, I'm noticing that the app will throw Oracle End of File Communication errors periodically during the day. I'm using Strongly typed Datasets to interact with the DB. I have a couple of questions:

1. What type of cleanup should I be performing? Should I be closing/disposing the connection or Adapter instance or is this handled internally by the dataSet?

2. I have the connection pooling set to the default - 100. Should I increase this or will this cause other performance issues? How would one test to see if the connection pool is maxing out? Could this be causing the Oracle EOF (ORA-03113) errors?


How to create strongly typed datasets with access parameter queries



How can you create strongly typed datasets using an access database against access select statements that use parameters?

The problem is VS.Net doesn't allow select queries with parameters to be dragged onto a form, it only allows access queries without parameters!

I also tried the dataadapter wizard, but again it only allows me to select queries without parameters?

Many thanks in advance


asp.net insert into 3 related tables using three tier architecture and typed datasets

I am using ASP.NET (C# and sql server express 2005) for my web application project. I have three related tables.I want to do an insert using typed datasets,tableadapters and three tier architecture.I wish to know how to do simultaneous inserts in 3 tables.So i wish to insert a row in first table and get its primary key.Same with the second table.I will use the primary keys of those first two tables to do the insert in the third table.How can i accomplish this using formview control and what methods should i use??Please give me suggestions.thanks in advance for reading this. I really appreciate it.

Problem with SCOPE_IDENTITY in strongly typed datasets



I am developing an ASP.NET site and I am using strongly typed datasets and I am generating them automatically in Visual Studio 2008. I have been using TransactionScope to be able to use several table adapters from different datasets and update them in one transaction. When I create a new row, I use the update method in the table adapter to create new posts. The update method takes a dataset, datatable or a row as argument making them very easy to work with. After I have updated a row, I have generated a ExecuteScalarGetIdValue() call to get the latest inserted ID value. I use "SELECT SCOPE_IDENTITY" and it gives me an exception. When I try the query builder this SELECT SCOPE_IDENTITY is returning NULL. When I ask it in SQL Management Studio SQL Query window it returns a correct value. How can I get the correct value from the table adapter?

        id = this._event.ExecuteScalarGetIdValue();



      return true;

 Best regards, Janhe

Strongy typed datasets, tableadapters and transactions


I'm using a stronly typed dataset built with the Visual Studio dataset designer for a .Net 2.0 application (cannot move above 2.0 unfortunatly)

On a simple level my database has two tables, Persons and Addresses. An Address record has a foriegn key to a Person from the Persons table.

When a new Person is created an Address is also inserted for the Person, I'd like this to be in a single transaction that can be committed or rolledback using the tableadapters.

This approach seems very close: http://www.codeproject.com/KB/dotnet/transactionta.aspx

This method is failing when the dataset is set to Refresh records on Insert/Update, but I need this Refresh to pull the ScopeIdentity and update the dataset so I know the new ID of a created record in Persons or Addresses.

Any ideas?

Autogenerated strongly typed datasets: change database



I have a data access layer in my application where I put all my *.xsd files (strongly typed datasets) that are autogenerated using Visual Studio 2010.

To be able to change target database I do the following manually in Visual Studio. Then I recompile and publish to web server.


1. Change database namn in connectionstring in Settings file under Properties in my DAL class library.

2. Find and replace database namn in all occureances of "DbObjectName="DBNAME.dbo.".

3. Find and replace database namn in all occureances of "DataSourceName="DBNAME.dbo.".


This seems to work but is not an optimal procedure so my question is:

There must be a better way, can I do this programmatically?


Best regards, Janhe

Generate strongly typed datasets from xml


I am following an articles about strongly typed datasets in vs.net. After creating my xml file and creating the schema file, when I right click to "generate dataset, that option is not available in Visual Studio 2005. How do I do this?


Introducing ADO.NET and the Typed DataSet

In reviewing the applications it seemed everything they were doing involved database reads, writes, and manipulation. The development staff had been reviewing the articles and code samples for ADO.NET. They had spent many years refining their existing ADO based infrastructure and perfecting their use of ADO

UnTyped DataSets and Strongly Type DataSets

We all are use datasets as a means of carrier of data from one layer to another. Most of the time we are using weakly typed datasets. In this article I will explain the differences between weakly typed datasets and strongly type datasets

Create and Use a Typed DataSet by Using Visual C# .NET

This article shows you how to create and use a typed DataSet in a small Web application. Typed DataSets, which inherit from the DataSet class, create first-class members of a DataSet's DataTables and DataColumns, yielding the many benefits that come with the use of strong typing.

Introduction to strongly Typed Data Sets

This article teaches how to create a strongly-typed dataset class library in your C# database applications. Our objectives are as follows:

.Learn what an strongly-Typed Data Set is
.Let Visual Studio Create a ST Data Set
.(Semi)Manually create a ST Data Set using XSD (Xml Schema Definition)

Cutting Edge: DataSets vs. Collections


In software, five years is like a geological era. Five years ago, the Microsoft® . NET Framework had just been announced. Since then, the DataSet has emerged as the key object for performing a variety of data-related tasks in .

Dino Esposito

MSDN Magazine August 2005

Cutting Edge: Binary Serialization of DataSets


The ADO. NET DataSet object plays an essential role in most of today's distributed, multitiered applications. Instances of the DataSet class are used to move data across the tiers and to exchange data with external services.

Dino Esposito

MSDN Magazine October 2004

The XML Files: Web Services and DataSets


Programmers using Visual Basic® 6. 0 have long bowed to the altar of the ADO recordset. It's probably the most commonly used data structure in Windows®-based applications today. The ADO. NET DataSet is poised to play a similar role in the realm of managed Windows-based applications.

Aaron Skonnard

MSDN Magazine April 2003

pass parameter between datasets



I've a user table, and contact table linked to it, and appointments where contact are linked to it with users in this in it.

I need a report which show ...by user number of contact created by this user and number of appointment created

so i guess i need two datasets but how can I pass parameters between them to know what is the current user id ..?

thanks so much  

using CompositeCollection in ListBox for merging two Typed DataTable

Hi i have a Typed DataSet contining two DataTable : Table1 , Table2 i want to merge the two Tables in a ListBox by using "CompositeCollection " , but this doesn't work <ListBox.ItemsSource> <CompositeCollection> <CollectionContainer Collection="{Binding Path = Table1}"/> <CollectionContainer Collection="{Binding Path =Table2}"/> </CompositeCollection> </ListBox.ItemsSource> i put also : public partial class Window1 : Window { public Window1() { InitializeComponent(); this.FillDataset(); this.DataContext = ds; //this.Resources.Add("mytable1", DataSet1.Table1); }   i want to confess i don't have a clear idea about referencing an object as a Typed DataTable. also if a want to Template my ListBox lique this :    <ListBox.ItemTemplate> <DataTemplate DataType="{x:Type myprog:DataSet1+Table1 }"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=ProductName}" Background="AliceBlue"/> </StackPanel> </DataTemplate> <DataTemplate DataType="{x:Type myprog:DataSet1+Table2 }"> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Path=ProductName}&quo
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend