Click here to Skip to main content
15,895,462 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
how can i get only a name of a column in my table from sqlserver?
i used the method GetSchemaTable() but it's return all the properties of a column as well as the name but i just want the ColumnName.
please do you know a method or any way to get only a Columname from sqlserver?
Posted

1 solution

 
Share this answer
 
Comments
Member 12078351 22-Dec-15 6:29am    
Thanks for this Answer.
how can i get a columnname of a specific cell of DataTable from SqlServer.
I explane myself:
i have a value of a cell and i want to get a columnname of this value. So i know that: "reader.GetName()" give me the Name of a column and "reader["columnname"].ToString()" give the value of the Cell. supposed i only have a cell value how can i get the columnName of this cell Value? "ColumnName of reader["columnname"].ToString()" ? thanks for your Help.
Richard MacCutchan 22-Dec-15 7:43am    
reader["columnname"]
Well that looks very much like the colum name to me.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900