By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,401 Members | 814 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,401 IT Pros & Developers. It's quick & easy.

can this coding be automated???

P: n/a
Hey

..NET 2.0
I'm on a project where I'm now about to develop the Data Access Layer. The
database have 300 stored procedures. I'm about to go on a time consuming
process of writing the .NET code which calls all these stored procedures.
Each stored procedure should get it's own method in the Data Acess Layer..

can this be automated, so for example VS2005 generates the code
automatically? any links about it?

I hope this can be automated a bit, so it can save me time....

all suggestions are welcome :)

Jeff

Nov 15 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Nov 15, 11:25 am, "Jeff" wrote:
Hey

.NET 2.0

I'm on a project where I'm now about to develop the Data Access Layer. The
database have 300 stored procedures. I'm about to go on a time consuming
process of writing the .NET code which calls all these stored procedures.
Each stored procedure should get it's own method in the Data Acess Layer..

can this be automated, so for example VS2005 generates the code
automatically? any links about it?

I hope this can be automated a bit, so it can save me time....

all suggestions are welcome :)

Jeff
If you're talking about automating the code writing you could always
cheat and code a loop through each of the stored procedures from one
of the system tables that will write the syntax of a function to a
textfile then copy the text into the editor.
Nov 15 '07 #2

P: n/a
Strongly typed datasets will give you a DAL pretty rapidly. Check out
this article:

http://aspnet.4guysfromrolla.com/articles/020806-1.aspx

Colby
Nov 15 '07 #3

P: n/a
Or, even better, you could use the classes in the System.CodeDom
namespace to generate the code structure for you.

You can also create an instance of the MSDataSetGenerator class in the
assemblies in the VS.NET IDE directory. You can use those to generate the
code wrappers for the stored procedures yourself.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"cfps.Christian" <ge*******@otc.eduwrote in message
news:51**********************************@f13g2000 hsa.googlegroups.com...
On Nov 15, 11:25 am, "Jeff" wrote:
>Hey

.NET 2.0

I'm on a project where I'm now about to develop the Data Access Layer.
The
database have 300 stored procedures. I'm about to go on a time consuming
process of writing the .NET code which calls all these stored procedures.
Each stored procedure should get it's own method in the Data Acess
Layer..

can this be automated, so for example VS2005 generates the code
automatically? any links about it?

I hope this can be automated a bit, so it can save me time....

all suggestions are welcome :)

Jeff

If you're talking about automating the code writing you could always
cheat and code a loop through each of the stored procedures from one
of the system tables that will write the syntax of a function to a
textfile then copy the text into the editor.

Nov 15 '07 #4

P: n/a
CodeSmith is your friend. It'll do exactly what you described...

--
Chris Mullins

"Jeff" <it************@hotmail.com.NOSPAMwrote in message
news:eT**************@TK2MSFTNGP03.phx.gbl...
Hey

.NET 2.0
I'm on a project where I'm now about to develop the Data Access Layer. The
database have 300 stored procedures. I'm about to go on a time consuming
process of writing the .NET code which calls all these stored procedures.
Each stored procedure should get it's own method in the Data Acess Layer..

can this be automated, so for example VS2005 generates the code
automatically? any links about it?

I hope this can be automated a bit, so it can save me time....

all suggestions are welcome :)

Jeff

Nov 15 '07 #5

P: n/a
Take a look at the Repository Factory. You can find it on Codeplex.com here:

http://www.codeplex.com/RepositoryFactory
--Peter
http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"Jeff" wrote:
Hey

..NET 2.0
I'm on a project where I'm now about to develop the Data Access Layer. The
database have 300 stored procedures. I'm about to go on a time consuming
process of writing the .NET code which calls all these stored procedures.
Each stored procedure should get it's own method in the Data Acess Layer..

can this be automated, so for example VS2005 generates the code
automatically? any links about it?

I hope this can be automated a bit, so it can save me time....

all suggestions are welcome :)

Jeff

Nov 15 '07 #6

P: n/a
Jeff

Subsonic is all the rage now. I believe that will help you out.

Personally I use the ADO.NET Code Generator by Robbe Morris (Google it).
It's on eggheadcafe and it works great. The source code is included. It
will generate base classes, interfaces, as well as stored procedures.

- Will
>"Jeff" <it************@hotmail.com.NOSPAMwrote
can this be automated, so for example VS2005 generates the code
automatically? any links about it?
Nov 15 '07 #7

P: n/a
I know you said .NET 2.0, but just for reference; looking ahead a few
weeks, LINQ-to-SQL does exactly this (limited to SQL Server).
Advantages: app part of standard VS toolkit; get to play with LINQ;
Disadvantages: maybe not as feature rich as some others.

Marc
Nov 16 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.