retiveig columns
-
hi all.... plz let me know how to retrieve the column names of a given table.....without content(data),just only column names not like select * from sometable and sp_help sometable Plz help me,,thanqs in advance :rose:
-
hi all.... plz let me know how to retrieve the column names of a given table.....without content(data),just only column names not like select * from sometable and sp_help sometable Plz help me,,thanqs in advance :rose:
Hi, how are you..? you should try this... use this for loop for getting names of all columns in table... DataTable dt = new DataTable(); string[] columnsNames = new string[dt.Columns.Count]; for (int i = 0; i < dt.Columns.Count; i++) { columnsNames[i] = dt.Columns[i].ColumnName.ToString(); } Bye ...
Chirag Patel
-
Hi, how are you..? you should try this... use this for loop for getting names of all columns in table... DataTable dt = new DataTable(); string[] columnsNames = new string[dt.Columns.Count]; for (int i = 0; i < dt.Columns.Count; i++) { columnsNames[i] = dt.Columns[i].ColumnName.ToString(); } Bye ...
Chirag Patel
hi patel....thanqs,,the code snippet worked for me