Get Table Fields Description
-
Hi I want to get sql server table fields Description, I want to use them for my datagrids header text. So how can i get field description from database table? Tanks
-
Hi I want to get sql server table fields Description, I want to use them for my datagrids header text. So how can i get field description from database table? Tanks
freshonlineMax wrote:
I want to get sql server table fields Description
What makes you think there ought to be one? Take a look at DataColumn class in your documentation, you'll see it has no description member. I usually name my columns in the database in a human friendly way so that I'd name the DataGridColumns with the same string using a loop -with some modifications of course like removing underscores-.
Regards:rose:
-
freshonlineMax wrote:
I want to get sql server table fields Description
What makes you think there ought to be one? Take a look at DataColumn class in your documentation, you'll see it has no description member. I usually name my columns in the database in a human friendly way so that I'd name the DataGridColumns with the same string using a loop -with some modifications of course like removing underscores-.
Regards:rose:
Just because the DataColumn class doesn't have such a property doesn't mean there is now way to get this info... Robert
-
Just because the DataColumn class doesn't have such a property doesn't mean there is now way to get this info... Robert
Robert Rohde wrote:
doesn't mean there is now way to get this info...
And what other ways do you know to get that information? Also when you make a Sql table where do you put that information?
Regards:rose:
-
Robert Rohde wrote:
doesn't mean there is now way to get this info...
And what other ways do you know to get that information? Also when you make a Sql table where do you put that information?
Regards:rose:
Dear Nade Elshahabi Please don't answer your friend's questions with an another question and let others to help and show the best way. I had a code to fetch database informations, but i lose it in my harddisk. If you don't have information about a subject you don't have to answer. I know you want to help, but others me be think, my problem have been solved. Regards
-
Dear Nade Elshahabi Please don't answer your friend's questions with an another question and let others to help and show the best way. I had a code to fetch database informations, but i lose it in my harddisk. If you don't have information about a subject you don't have to answer. I know you want to help, but others me be think, my problem have been solved. Regards
freshonlineMax wrote:
Please don't answer your friend's questions with an another question
I wasn't asking for an answer. I was proving my point of view that there is no description for Sql columns. If Robert knew how to get it he would have posted the answer. BTW where did you put that description anyway?!!
freshonlineMax wrote:
I had a code to fetch database informations, but i lose it in my harddisk.
Database information?? You mean that present in the INFORMATION_SCHEMA? Check the INFORMATION_SCHEMA.COLUMNS table and see if it has a description field!!
freshonlineMax wrote:
If you don't have information about a subject you don't have to answer.
:~
freshonlineMax wrote:
I know you want to help, but others me be think, my problem have been solved.
Sure! And forgive me -turely- if I blocked someone else from answering you. Your post is still there. He who has answer, let him benefit us all!! -- modified at 14:26 Saturday 28th October, 2006
Regards:rose:
-
Hi I want to get sql server table fields Description, I want to use them for my datagrids header text. So how can i get field description from database table? Tanks
-
Hi I want to get sql server table fields Description, I want to use them for my datagrids header text. So how can i get field description from database table? Tanks
you can retrieve data from SQL select : select b.name,c.value from syscolumns b, sysobjects A,sysproperties c where a.name ='bed' and a.id=b.id and b.id=c.id and b.colorder=c.smallid then use this rows to modify your datagridview column tex if you can design this, i may design class for you: SetDatagridColumnTextBySqlDescribe(DatagridView dview)
Think ...
-
freshonlineMax wrote:
Please don't answer your friend's questions with an another question
I wasn't asking for an answer. I was proving my point of view that there is no description for Sql columns. If Robert knew how to get it he would have posted the answer. BTW where did you put that description anyway?!!
freshonlineMax wrote:
I had a code to fetch database informations, but i lose it in my harddisk.
Database information?? You mean that present in the INFORMATION_SCHEMA? Check the INFORMATION_SCHEMA.COLUMNS table and see if it has a description field!!
freshonlineMax wrote:
If you don't have information about a subject you don't have to answer.
:~
freshonlineMax wrote:
I know you want to help, but others me be think, my problem have been solved.
Sure! And forgive me -turely- if I blocked someone else from answering you. Your post is still there. He who has answer, let him benefit us all!! -- modified at 14:26 Saturday 28th October, 2006
Regards:rose:
Hello Again Dear friend 'Nader Elshehabi' I solve my problem my self!:cool: Now i can help myself, you(if agree) and others (if it's useful!) Just run below query in sqlServer:
SELECT objtype, objname, name, value FROM ::fn_listextendedproperty(NULL, 'user', 'dbo', 'table', 'YourTablename', 'column', DEFAULT) AS fn_listextendedproperty_1
If we want to get special column's description, we should type column's name instead of 'DEFAULT'. Field 'value' refers to column's description. Regards:)