473,509 Members | 2,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Am I doing it right?

Hi All

Can someone tell me if I am doing this correctly, or can possibly suggest better ways, if I'm not doing this correctly.

I have a windows application that I am writing,So I have a UI and I have another class that handles the inserts,updates etc to a specific table/s in the database,(I actually have multiple classes that do more or less the same thing, but for different sets of tables in the database) Then in my UI code I have a dataset that I fill by calling a method from one of my classes, that returns a datatable, and I add that table to my dataset in the UI. When I want to add/delete/update data, I do so in the UI's dataset and send the specific datatable in the ui's dataset to the class to update the database. Am I doing this correctly?

I'm sure there is probably a way to cut out the multiple classes for each table or set of tables, like create a base class? but how do I do that? Anyone got any links I can go to for this - if it is a better solution? I did this "multiple classes for tables/sets of tables" because of the layout of the tables, each table of course has different column names, and data types, and there are times when I need to reference a specific column etc.

But overall, am I approaching this correctly? Any insight into streamlining this is greatly appreciated. Thanks alot

Kevin - C# Beginner
Nov 15 '05 #1
1 1338
L#
On Thu, 5 Feb 2004 21:31:06 -0800, "Kevin"
<an*******@discussions.microsoft.com> wrote:
Hi All

Can someone tell me if I am doing this correctly, or can possibly suggest better ways, if I'm not doing this correctly.

I have a windows application that I am writing,So I have a UI and I have another class that handles the inserts,updates etc to a specific table/s in the database,(I actually have multiple classes that do more or less the same thing, but for different sets of tables in the database) Then in my UI code I have a dataset that I fill by calling a method from one of my classes, that returns a datatable, and I add that table to my dataset in the UI. When I want to add/delete/update data, I do so in the UI's dataset and send the specific datatable in the ui's dataset to the class to update the database. Am I doing this correctly?

I'm sure there is probably a way to cut out the multiple classes for each table or set of tables, like create a base class? but how do I do that? Anyone got any links I can go to for this - if it is a better solution? I did this "multiple classes for tables/sets of tables" because of the layout of the tables, each table of course has different column names, and data types, and there are times when I need to reference a specific column etc.

But overall, am I approaching this correctly? Any insight into streamlining this is greatly appreciated. Thanks alot

Kevin - C# Beginner


Maybe you could have a look at typed datasets.

http://www.c-sharpcorner.com/Code/20...edDataSets.asp

--
Ludwig
mailto:ludwig_(nospamplease)stuyck@pandora(nospamp lease).be
Nov 15 '05 #2

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

Similar topics

1
1907
by: Viken Karaguesian | last post by:
Hello all, I'm taking a shot at table-less design, but I feel like I'm poking in the dark here. I decided to try and recreate the main page of a webiste that I run, www.sayatnova.com, using CSS...
11
2471
by: Sims | last post by:
Hi, I have a function that looks something like .... void Function( std::string &oldval ) { int iSome_size = xxx; // get some size char *tmp = NULL; tmp = new char;
1
2012
by: Chris Uwins | last post by:
Hi there, i know theres a number of ways I can achieve this but want to know the best, (but still quite simple). Up until a year ago I never used Access but have designed a few databases for...
7
1340
by: Ed Jay | last post by:
Well, nobody in alt.html wants to answer this question, so I'll ask it here: I have a button and associated text in a container. When one clicks the button it brings up additional buttons and...
4
1589
by: esebastian | last post by:
Hello Everyone, I would just like some advice to make sure i am doing what i want to do the right way because i don't think i am. I have a form that contains checkboxes. The checkboxes are...
0
1723
by: Nightcrawler | last post by:
I hope this is the right group for this question. I recently started looking into AJAX and I am doing the following: I have a repeater (dummydata) that is bound to a datatable (Articles). Each...
4
1268
by: Benoit Lefebvre | last post by:
Weird subject you will say.. I didn't know what to put in there.. Long story short, I'm changing the value of a variable from a function.. Nothing unusual there.. How come the value of the...
14
1788
by: jmDesktop | last post by:
I have a food menu. Each area, like beverages, grill, etc. have items under them, Coke, Tea, Coffee would be under beverages for example. I want to add a new drink to beverages. In my database...
6
51141
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just...
0
7137
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
7347
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7416
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...
1
7073
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...
0
5656
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3218
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3207
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1571
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
443
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.