473,903 Members | 5,147 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically Building SQL Statment

First off, i apologize if my terminology is off...

I am currently in a project that is basically a front-end to a
database. In coding this, I am taking into account that it has the
*potential* to be front-ended on multiple databases as well as
rendered in multiple browser types.

That being said, is there a pre-constructed class out there that I
can call from within my code to systematically "build" my SQL
statement and have it take into account the possibility to front
multiple databases? I am not looking to use stored procedures or
anything like that...it will be a simple CRUD-style SQL statment.

Simply put, I want to instantiate a query object and call methods
like AddSelect(), AddFrom(), AddWhere, AddOrder() to build the
statment that would be submitted to the database.
Thank You
Adam
Nov 16 '05 #1
1 1751

----- Original Message -----
From: "Me, Myself, and I" <sp**@slufact0r y.com>
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
Sent: Thursday, February 24, 2005 2:07 AM
Subject: Dynamically Building SQL Statment

First off, i apologize if my terminology is off...

I am currently in a project that is basically a front-end to a
database. In coding this, I am taking into account that it has the
*potential* to be front-ended on multiple databases as well as
rendered in multiple browser types.

That being said, is there a pre-constructed class out there that I
can call from within my code to systematically "build" my SQL
statement and have it take into account the possibility to front
multiple databases? I am not looking to use stored procedures or
anything like that...it will be a simple CRUD-style SQL statment.

Simply put, I want to instantiate a query object and call methods
like AddSelect(), AddFrom(), AddWhere, AddOrder() to build the
statment that would be submitted to the database.
Thank You
Adam


Hi Adam,

How complex are your SQL strings likely to be?

While there is a lot to be said for a generic class that handles a lot of
different types of queries, you have to think about how this generic class
will cause other areas of your program to become more complex.

If you have a query that is often used but only ever changes in how it
searches in certain columns, (ie SELECT [name], [age] FROM [Employees] WHERE
[name] = mySearchTerm1 AND [city] = mySearchTerm2) , then it would be better
for future reference if you simply held the entire string in a class and
changed the parts that you needed to change no?

Sorry if I've missed your point!
Rich.
Nov 16 '05 #2

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

Similar topics

0
1143
by: goitz | last post by:
Im looking for a way to dynamically create a table and append a text box to it using a list of information from a database eg> display a results of a select statment then add a text box--> field1 field2 textbo datagrids only allow clicking a button to edit a field, too much clicking to edit multiple fields required Please help
2
1095
by: djc | last post by:
I have something like the following: --------------------------------------------------- Dim btnAddUpdateDetail As New LinkButton() btnAddUpdateDetail.Text = "Add/Update Issue Detail" btnAddUpdateDetail.CommandName = "AddUpdateDetail" AddHandler btnAddUpdateDetail.Command, AddressOf HandleActions ActionsPanel.Controls.Add(btnAddUpdateDetail) Dim BR1 As New Literal()
5
1307
by: Jason | last post by:
Hi all I am building a page dynamically on Page_Load. using Table web controls for this. the web page builds up and loads up and displays ok. but as soon as there is a post back of any sort, all my dynamic building is gone. the page reverts back to it's "original" design time state. i have a OK button, that when the user clicks on this button, it will go and get data from the dynamically built page. but obviously i cant do that,
0
1072
by: Craig G | last post by:
i want to build a datagrid to use as a register for a number of courses. what i want to happen is that the tutor selects the course from a combo box. this then builds a grid for all students enrolled on the course along with the number of weeks the course has to run i want the datagrid to build a column for each week of the course. and then list the students in rows. with a checkbox being in every itemtemplate so that the tutor can say...
2
11429
by: ahmad | last post by:
when i used the statment for(var i = 0; i < menu.length; i++) { menu.options.selected = "false"; } to deselect all the options within a list, it surprisingly selected all the options. I tried another option like menu.options.removeAttribute("selected");
7
10077
by: Steve_Black | last post by:
Hello, I'm toying with the idea of loading a MenuStrip (VB.Net 2005) dynamically based on who is logged into my system. Every user has different security settings and I want to customize the main menu instead of showing all possible options and only enabling/disabling certain ones. I have a table that stores the menu item name, parent item (if applicable), display order, etc. so that I can dynamically load my
1
1596
by: zeebiggie | last post by:
Good morning I have a form with the controls in the insert statment below. table1 has an Auto increment primary key hence is omitted in the insert statment and form. Am getting the error It didnt work " .mysql_insert_id(); and not any other php or mysql error to tell me if anything is wrong the insert statment. To top it up, I have an echo statment of the insert statment before it executes, when I copy and paste the insert statment from...
2
2096
by: grant | last post by:
Man do I struggle with Enterprise Manager as a graphical tool for building views etc. Its flaky and hangs frequenlty so i have to kill it with the task manager and re open it. You cant debug functions ( or am I missing something) But the worst thing is that it appears to cache the results of views and doesnt refresh from the source.
8
2830
by: BillE | last post by:
When I create a control dynamically and it grows according to the content, the control Height property still returns the original default control height instead of the height after expanding. How can I get the height of the control (in code) after it grows? I am building a windows form dynamically, creating controls and placing them on the form. There can be dozens of controls of all types on the form. This is for dynamic...
0
9847
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10873
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10500
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9684
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8048
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7206
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5894
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6088
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.