get somthing like alias from a sql database column
hi
i have a datagridview in my form that get data from a sql database through a datatable .
in database tables has a name that it use as datatable's column headerName.but i want to named column headerNames by a different name like alias of each column of sql table .
but i dont know how can get an alias name or a description of each database column ( as alias ) from database . please help me about it .
Re: get somthing like alias from a sql database column
Well you obviously can't get it from the database because it isn't recorded in the database. You can disable automatic column addition for the DGV and set it up in advance of populating the table with your own columns and the required headers by manually setting the display members accordingly.
Re: get somthing like alias from a sql database column
i define a description for each column of sql table . (this description is my headerText) . but i dont know how can i get this description in my application through datatable . is there any way to do this ?
if this problem is solved my problem is solved .pls
Re: get somthing like alias from a sql database column
I may be missing the point but you mean something like:
select getdate() 'current date'
and the column name would be 'Current date'
Re: get somthing like alias from a sql database column
Normally, you would do something like this in the SELECT statement, as you can provide an alias there. Is that not an option in this case?