Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Adding a Table name to a the list

Posted on 2007-03-21
1
Medium Priority
?
228 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
[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
1 Comment
 
LVL 16

Accepted Solution

by:
Hillwaaa earned 1500 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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

704 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