Im using c# windows form application. I have a database with many tables. Each table has several columns. I need to populate the combo box with the column names for a selected table.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The proper way of doing this on SQL Server 2005 and up (you didn’t specify quite clearly what version you’re using) would be to inspect the system catalog view, which live in the
sysschema:The
sys.columnscatalog view gives you quite a bit of information about the columns for a table – the table is identified by theobject_idcolumn, which is the internal ID for that table in question.