Solved

Modify asp.net web site classes based on SQL Table definition

Posted on 2013-01-22
4
193 Views
Last Modified: 2013-02-05
Hello EE, big question for you.

I have a web site in my company in .NET with C#.

the site is architectured with BLL, DAL, SqlClient classes and so forth.

Not all employees knows .NET and let's say we add a column to a SQL table, let's say table A, well we need to go change at at least 2-3 places like the class Customer (that has get set Properties, the sqlClient parameters for the update and insert statements, the CustomerDetails DataReader ...


Is there a way to create/recreate the customer.cs (get set properties) based on the SQL table definition ? That way no one would need to get modify it would help me so much.

same thing for the other classes... any ideas on that ?

I know there is a limit to do nothing...I dont mind to do changes if I want to lets say add a asp:Label from the new column thats ok to go manually add it in the Web Form page...

thanks.
0
Comment
Question by:PhilippeRenaud
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38807872
Model: When doing it in a classic ADO.NET way there isn't any easy route. If you are using Entity Framework or something similar, you might have a luck on updating the Model based on Database changes.

Queries: You surely need to update the queries. Now if you are using storedprocs then updating it won't need any  developer involvement.

View/UI: As you said, it has to be done unless you are using DataBound controls with auto-generated columns.
0
 
LVL 1

Author Comment

by:PhilippeRenaud
ID: 38810116
Maybe I could create a program thats goes write inside a .VB file like we do with .TXT files ?

I could generates new lines of .net codes without any programmor doing it has he would only give me the new column name of the table

i would generate automatically all new lines with something like StringBuilder then copy into the vb.net file ?

I dont need to compile since its not an application right ?
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38812391
It depends where the changes are made. If by .vb you mean code-behind then for asp.net Website project it will be a dynamic compilation.
0
 
LVL 1

Author Closing Comment

by:PhilippeRenaud
ID: 38855961
thks for info
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now