473,394 Members | 1,956 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Is there way to do global changes to SQL in ASP pages

We have over 100 asp pages that reference a table (distribution_components).
We added a new column and primary key to that table, so now we have to modify
the where clause to include that column (we have to make the new column = to a
session variable in the page)

The table appears 531 times in our code. Is there some util or method that
allows us to change it globally, other than going to each occurrance, and
adding the new column to the where clause
Nov 17 '05 #1
3 985
I assume you didnt have the ability to write stored procs when you first
started out...

How do you know it appears 531 times? If you use VS.Net, or any other text
editor that has an MDI interface, you can do a find replace throughout your
pages to determine where the table name is, then add it.

A texteditor that has an MDI, in case you dont have one, is available at
www.notetab.com.
--
Elliot M. Rodriguez, MCSD
*** It would take 227 cans of Mountain Dew to kill me***

"johnston" <jo******@thot.com> wrote in message
news:3f***********************@newscene.com...
We have over 100 asp pages that reference a table (distribution_components). We added a new column and primary key to that table, so now we have to modify the where clause to include that column (we have to make the new column = to a session variable in the page)

The table appears 531 times in our code. Is there some util or method that allows us to change it globally, other than going to each occurrance, and
adding the new column to the where clause

Nov 17 '05 #2
In article <Ox*************@TK2MSFTNGP11.phx.gbl>, "Kevin Spencer" <ke***@takempis.com> wrote:
Are you telling us that you duplicated the same SQL query string 531 times
in your code?

No, it is different most of time. The table is referenced multiple times to
get different pieces of info, sometimes by istelf other times in a join.

Nov 17 '05 #3
Well, I think you're just going to have to bite the bullet here. This is one
case that brilliantly illustrates the necessity of having good program
architecture! ASP.Net pages are user interfaces, and as such, in a large
application, shouldn't have any direct database calls in them. It would have
been helpful to put your database calls into a class library, and your SQL
in Stored Procedures.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big things are made up of
lots of little things.

"johnston" <jo******@thot.com> wrote in message
news:3f***********************@newscene.com...
In article <Ox*************@TK2MSFTNGP11.phx.gbl>, "Kevin Spencer" <ke***@takempis.com> wrote:
Are you telling us that you duplicated the same SQL query string 531 timesin your code?

No, it is different most of time. The table is referenced multiple times

to get different pieces of info, sometimes by istelf other times in a join.

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Faisal | last post by:
Hi. I'm in the process of moving an application from ASP to ASP.NET, & I'm writing in VB, using VS.NET. I'm new to the .NET framework & have a basic question regarding static objects defined in...
22
by: fd123456 | last post by:
Hi Tom ! Sorry about the messy quoting, Google is playing tricks on me at the moment. > Global.asax is where you normally have the Global Application > and Session variables and code to...
12
by: John M | last post by:
Hello, On Microsoft Visual Studio .NET 2003, I want to use some global elements, that can be used in each one of my pages. i.e I put a oleDBConnection on global.asax.vb How can I use it...
8
by: Thomas Coleman | last post by:
Ok, I've obviously discovered that Global.aspx has been completely changed in ..NET 2.0. However, I haven't figured out how to declare a constant that's available to any page in my application...
2
by: Steve | last post by:
I am new to this newsgroup & to .NET in general. I have been playing around with Visual Studio .NET, building and rendering web pages using VB "code behind" files. My problem / question is; How...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.