473,386 Members | 1,621 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,386 software developers and data experts.

Populate a class automatically?

I am using an objectdatasource and binding to an aggregate data type.

My aggregate data type is ebing populated like:

http://www.rafb.net/paste/results/6WeLS821.html

Is there some way of automatically doing this?
Something like:

MyClass = myDataSet; //yes I want to be lazy :P

The approach on the code uses only a couple of parameters which is fine,
but my app will have excess of 20 parameters.

Thanks in advance

Steven

*** Sent via Developersdex http://www.developersdex.com ***
Feb 24 '06 #1
5 2896
You could build a constructor that takes a dataset, or use a code
generator to do all the boring monkey code.

BugSentry needs beta testers!
www.bugsentry.com

*** Sent via Developersdex http://www.developersdex.com ***
Feb 24 '06 #2
Check out DevForce from IdeaBlade (www.ideablade.com). There is a free
Express version for client-server, SQL Server applications. Anyway, it
generates your business objects from your database schema (with your
tweaks). It also handles the bi-directional data binding and other
complexities of building regular database business applications. I'm a
satisfied client.

Feb 24 '06 #3
I built a code generator to do all this crap for me.
I'm not proud of the code in the sample but the
code it generates is pretty solid.

http://www.eggheadcafe.com/articles/..._generator.asp

--
Robbe Morris - 2004-2006 Microsoft MVP C#
http://www.eggheadcafe.com/forums/merit.asp

"Steven Blair" <st**********@btinternet.com> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl...
I am using an objectdatasource and binding to an aggregate data type.

My aggregate data type is ebing populated like:

http://www.rafb.net/paste/results/6WeLS821.html

Is there some way of automatically doing this?
Something like:

MyClass = myDataSet; //yes I want to be lazy :P

The approach on the code uses only a couple of parameters which is fine,
but my app will have excess of 20 parameters.

Thanks in advance

Steven

*** Sent via Developersdex http://www.developersdex.com ***

Feb 26 '06 #4
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:OS**************@TK2MSFTNGP10.phx.gbl...
I built a code generator to do all this crap for me.


Me too. Basically, it is a simple WinForms app which works thus:

1) The user types in the SQL Connection string and hits the "Connect"
button.

2) Assuming the connection is successful, a ComboBox is populated with all
the user tables in the database specified in the SQL connection string

3) When the user selects one of the tables listed in the ComboBox, the
following code is generated:

a) INSERT stored procedure
b) UPDATE stored procedure
c) DELETE stored procedure
d) EXISTS stored procedure
e) SELECT stored procedure
f) C# class with all of the fields from the tables as properties, an
Insert() method, an Update() method, a Delete() method, an Exists() method
and a Select() method

This does about 95% of everything I need.
Feb 26 '06 #5
than generating basic stuff. This guy creates object oriented
layers of ADO.NET code based on the existing stored procedures
and tables.

--
Robbe Morris - 2004-2006 Microsoft MVP C#
http://www.eggheadcafe.com/forums/merit.asp

"Mark Rae" <ma**@markN-O-S-P-A-M.co.uk> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"Robbe Morris [C# MVP]" <in**@eggheadcafe.com> wrote in message
news:OS**************@TK2MSFTNGP10.phx.gbl...
I built a code generator to do all this crap for me.


Me too. Basically, it is a simple WinForms app which works thus:

1) The user types in the SQL Connection string and hits the "Connect"
button.

2) Assuming the connection is successful, a ComboBox is populated with all
the user tables in the database specified in the SQL connection string

3) When the user selects one of the tables listed in the ComboBox, the
following code is generated:

a) INSERT stored procedure
b) UPDATE stored procedure
c) DELETE stored procedure
d) EXISTS stored procedure
e) SELECT stored procedure
f) C# class with all of the fields from the tables as properties, an
Insert() method, an Update() method, a Delete() method, an Exists() method
and a Select() method

This does about 95% of everything I need.

Feb 26 '06 #6

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

Similar topics

5
by: rbt | last post by:
How can I make a python client script connect to a Web server and automatically populate form fields and then submit the form? For example, say I wanted to check and see if 1924 was a leap...
2
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to...
1
by: Greg Scharlemann | last post by:
I would like to automatically populate a drop down menu when the page loads based on the selection of an item in a different drop down menu. I made a test page that when drop down #1 changes, drop...
2
by: Chand | last post by:
Hello Everyboy I am creating a small scale db with following fields in the table and form for the data entry purpose. Product ID Product Name Manufacturer Location 101 ...
3
by: Yul | last post by:
Hi, We are in the process of designing an ASP.NET app, where a user will enter some 'Customer ID' to be queried in the database. If the ID is valid, several stored procedures will be called to...
3
by: Jordan | last post by:
Suppose I have a system that keeps track of 5 different types of "People". My intent is to have a base Person class, then 5 derived classes for each of the specific person types (e.g., Patient,...
1
by: j_michas | last post by:
Hi, Im looking to create a class to automatically check a pop address and populate a database with the messages it collects. The problem Im having is that most of the code I have found doesnt...
4
by: Sharon | last post by:
hello, I wanted to populate an array with the data from sql table, but not sure how to go about it. This is the array iam using at present, but i dont want to provide the values. Instead i...
11
by: eureka | last post by:
Hi All, I'm training in Servlets, JSP and JavaScript, I have a web page in which there's a "StudentName" textbox and below it is a "Names" Dropdown list. Initially the Textbox is empty and...
5
by: jazznojive | last post by:
I've created a textbox control on a userform and I am trying to figure out how to make the text populate to a worksheet range in sequence automatically. I've figued out how to get the text that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.