473,405 Members | 2,262 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,405 software developers and data experts.

C# APP Generate Dynamic SQL Statement from ListBox

hi, i am fresh grad and wondering whether this idea can be done..

i have 1 ComboBox and 2 ListBox. ComboBox contain list of table, when user select a table, it will list the field name for selected table in ListBox1. The ListBox2 will list the selected field name by user. It will display in list box with this format "tablename.fieldname". So far i have done until this.

Now i am wondering whether can create SQL statement for each table in ListBox2 (the selected field by user).
- example: if it have 5 tables, it generate 5 sql statement. The field name is the field which was selected by user.
- In ListBox2, it can have more than 1 table and more than 1 field for each table.
- No join statement

Objective: I want to allow user dynamically create sql statement, by allow user to select table name and field name.

So is it possible for the above to be done? if yes any help or any idea how to achieve that............
Dec 3 '08 #1
3 3877
Hi,

Somehow i manage to solve the previous post problem....
not sure whether it is long or what....
but it is working and able to generate the sql statement perfectly from the list box 2......

Thank You
..............
Dec 4 '08 #2
Hi, can anyone help me on this problem. It is quiet urgent......

i have two CheckedListBox (CLBa and CLBb) , and i want the user selected CheckedListBox is assign to two dimension array.

Objective:
There is a sql statement (select * from tblname where field1= ' ' OR field2=' '),
i want to allow user to choose the data for filetring,

where
- field1 will read selected item in CLBa
- field2 will read selected item in CLBb
- the sql statement is use for 1 table only

possibility
- single row might have selected data in field1 and field2
- row is not duplicated in the result of select statement

solution
- i plan to assign the selected item in CLBa and CLBb to a two dimensional array
- from the array i read the data and filter

problem
- how to assign the selected in both check box list to an two dimension array?



Thank you
Dec 5 '08 #3
Curtis Rutland
3,256 Expert 2GB
Please don't answer this last question in this thread. It has it's own:
http://bytes.com/answers/net/857501-...ay#post3440760
Dec 5 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Řyvind Isaksen | last post by:
Hello! I need to dynamic generate a SQL statement based on how many images a user select to upload. Here you see an example with 2 images. It can be up to 50 images and I dont want to write...
0
by: starace | last post by:
I have designed a form that has 5 different list boxes where the selections within each are used as criteria in building a dynamic query. Some boxes are set for multiple selections but these list...
1
by: JMann101 | last post by:
I am writing a ASP.NET(VB) application and am having some trouble. I have a datagrid which list users and when an admin clicks "edit" a defined column becomes visible and a dynamic listbox control...
1
by: Brian Henry | last post by:
I am working on an data bound list that implements of course IList, IBindingList, IComparer, etc... your basic things your need for data binding type objects... the problem is i got it to work...
8
by: George Meng | last post by:
I got a tough question: The backgroud for this question is: I want to design an application works like a engine. After release, we can still customize a form by adding a button, and source code...
4
by: ^MisterJingo^ | last post by:
Hi all, I have a web page which has a single dropdownlist containing 3 items. Below the dropdownlist are two listboxes. Depending on the option selected from the dropdownlist, the left most...
6
by: Dazbear | last post by:
Hi There Have been on a massive learning curve today creating an Access database without having even started the software before this morning! All going well and have learned to create table,...
4
by: Kevin Blount | last post by:
As mentioned before, I'm creating a multi-lingual page where the text of the page comes from a database. This page includes a registration form which asks for address information, including the...
1
by: skyson2ye | last post by:
Hi, guys: I have written a piece of code which utilizes Javascript in PHP to create a three level dynamic list box(Country, States/Province, Market). However, I have encountered a strange problem,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
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,...
0
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...

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.