Solved

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

Posted on 2013-01-22
4
194 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

929 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

18 Experts available now in Live!

Get 1:1 Help Now