473,395 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Dataset class in VS2008

AMP
Hello,
I click on Add Data Source and go through all the dialog boxes and
what I get is a class with a bunch of partial classes. I get that.
What I dont understand is why much of the code shows up many times.
I have included a snippet below. You dont have to read it...but this
gets repeated EXACTLY in every partial class.
There are over 10,000 lines in this IDE created class and it looks
like most of it is just repeated.
But I'm not sure, thats why I'm asking.
Thanks,
Mike
Ex:internal global::System.Data.SqlClient.SqlConnection Connection {
get {
if ((this._connection == null)) {
this.InitConnection();
}
return this._connection;
}
set {
this._connection = value;
if ((this.Adapter.InsertCommand != null)) {
this.Adapter.InsertCommand.Connection = value;
}
if ((this.Adapter.DeleteCommand != null)) {
this.Adapter.DeleteCommand.Connection = value;
}
if ((this.Adapter.UpdateCommand != null)) {
this.Adapter.UpdateCommand.Connection = value;
}
for (int i = 0; (i < this.CommandCollection.Length); i
= (i + 1)) {
if ((this.CommandCollection[i] != null)) {
((global::System.Data.SqlClient.SqlCommand)
(this.CommandCollection[i])).Connection = value;
}
}
}
}
Jun 27 '08 #1
1 1138
On May 1, 8:41*am, AMP <ampel...@gmail.comwrote:
Hello,
I click on *Add Data Source and go through all the dialog boxes and
what I get is a class with a bunch of partial classes. I get that.
What I dont understand is why much of the code shows up many times.
I have included a snippet below. You dont have to read it...but this
gets repeated EXACTLY in every partial class.
Hi,

Well the code you posted makes all the sense in the world, it appear
that the class (and I assume all the others too) have a DataAdapter as
a member and a property named Connection, that when it's set it update
all the connections of the commands of the DataAdapter.

I see no problem there.

Maybe if all the classes inherit from a common base and the above
functionality is implemented there then you (or the framework) do not
have to generate it so many times.

But again, I see no problem with that. I do not think you will end
with a much bigger code for that.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: DaveINOPS | last post by:
Trying to create a dataset out of an XML schema (.xsd), I get the following error message: DataSet doesn't support 'union' or 'list' as simpleType Using .NET2/VS2005. Is there a workaround? ...
7
by: Cirene | last post by:
I used to use the Web Deployment Project with my VS2005 projects. Now I've fully upgraded to VS2008. Do I have to download a new version of the Web Deployment Project? If so where can I find...
20
by: Iouri | last post by:
Hi everybody, We are currently using VS2003 and now we are in the porcess of upgrading to the next Visual Studio version. Does somebody have a real life experience with VS2008? My boss wants to...
2
by: Academia | last post by:
I have vs2005 installed on the System disk and vs2008 installed on a different disk. I want to remove VS2005. I read one time about some problem with uninstalling vs2005 after vs2008 is...
0
by: ker_01 | last post by:
I received a copy of VS2008 Standard Edition at a recent MS launch event. I need to test some code for MS Office (Excel) and also update a program I wrote in VS2003 for a mobile device (still to...
4
by: BillE | last post by:
I have found articles on line about using word interop for spell checking with visual studio applications. Most of the articles are several years old, though - VS2003, maybe 2005. I couldn't...
3
by: =?Utf-8?B?SmFtZXMgV29uZw==?= | last post by:
Hi everybody, There is a fatal error while installing VS2008 SP1 on Vista 64bit Business edition. The last line of error log is Installation failed with error code: (0x80070643) I tried to...
0
by: JerryShaw | last post by:
Problem: create a new winform app in C# VS2008. Drop a PropertyGrid component, Drop a DataSet (untyped) Set the PropertyGrid.SelectedObject to the DataSet. Run the application, and try to select...
1
by: dragon52 | last post by:
Hi, I am using VS2008 C#. I have manually created a typed dataset "DataSet1" then drag drop a table from an Access db. I want to populate this "DataSet1" from another dataset "dt" so that I can...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.