Alias Table column

hassanbenali

New member
Joined
Nov 15, 2010
Messages
3
Programming Experience
1-3
i have table contain 2 columns
string column1
string column2

the select statment in sql is
Select column1 as c1, column2 c2 from table

i use data adapter, and data set
how can i retrieve in datagridview both the column name and column alias
 
I believe you'd need to select the column twice to get that information.

VB.NET:
SELECT column1, column1 AS c1, column2, column2 AS c2 FROM table

You'll get separate columns with duplicate data doing this though.

I have to ask; why would you need this?
 
i have many tables and i want to make "one form for search" related to more than 10 differents table data or SQL Statment, i want to read the caption and put it in checklistbox and then retrieve its value to use it in Sql statement or rowfilter, your solution suppose hardcoded and not perfect solution,
 
Back
Top