|
-
May 15th, 2013, 11:56 AM
#1
Thread Starter
Lively Member
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 .
-
May 15th, 2013, 12:02 PM
#2
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.
As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"
Reviews: "dunfiddlin likes his DataTables" - jmcilhinney
Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!
-
May 15th, 2013, 12:35 PM
#3
Thread Starter
Lively Member
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
-
May 15th, 2013, 01:31 PM
#4
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'
-
May 15th, 2013, 01:40 PM
#5
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?
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|