Solved

Adding a Table name to a the list

Posted on 2007-03-21
1
180 Views
Last Modified: 2010-03-19
Hello Experts,

I have 3 tables in the database. Emp_Master,Dept_Master,Emp_salary. And I have a view which is shown below:

Select E.first_name,E.last_name,E.City,E.Age,D.Dept_Name,D.Dept_Code,ES.Salary,ES.Bonus,ES.LastBons from
Emp_Master E,Dept_Master D,Emp_salary ES
Where E.dept_id=D.Dept_id and E.emp_id=ES.Emp_id

I am displaying all the columns in a listbox in my ASPX page based on the query below:
SELECT column_Name as col,[dbo].[z360core_Get_CustomFieldAlias](column_Name) as ColumnName from Information_Schema.columns WHERE Table_Name=''EMPDeptView'' and Data_Type not In (''int'')

My question is, is there a way I can put a heading of the table Names as shown below in the Listbox:

Emp_Master
-------------------
First Name
Last Name
City
State
Dept_Master
-------------------
Dept_Code

 
0
Comment
Question by:rowmark
1 Comment
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 500 total points
ID: 18813578
Hi rowmark,

Can't think of a way to do that in the drop-down list, would it be acceptable to display the tablename next to the column:

Emp_Master:First Name
Emp_Master:Last Name
Dept_Master:Dept_Code

Then you could just remove everything left of the ":"

Alternately, you could write it so that instead of one drop down, you have 2, the first holds the table names, then once a table is selected, the second is populated with the column names for just that table.

Cheers,
Hillwaaa
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now