Solved

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

Posted on 2013-01-22
4
197 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to force output to ascii 2 41
Activating .NET Framework 3.5 and which option to choose 5 35
Calculating percentage 2 32
C# LINQ 5 27
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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