Solved

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

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

805 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