472,958 Members | 2,358 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 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 1123
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: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.