Can someone please help me with following problem. I have created a Sql table in SQl express but I want to create a drop down list directly in one of the columns in the sql database so that I can see the drop down list when I load my c# datagrid. Whats the best way of going about this. Thanks for any help.... -- Message posted via SQLMonster.com http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/200810/1
On Wed, 01 Oct 2008 22:04:33 GMT, "markyjj via SQLMonster.com" <u45734@uwe> wrote: >I have created a Sql table in SQl express but I want to create a drop down >list directly in one of the columns in the sql database so that I can see the >drop down list when I load my c# datagrid. Whats the best way of going about >this. The proper database design would probably be to create another table with just those values, make that column the key to the table, and place a foreign key constraint on the existing table pointing to that one. However to populate the list you could simply run the query: SELECT DISTINCT <column name> FROM <table name> Roy Harvey Beacon Falls, CT
markyjj via SQLMonster.com wrote: > Can someone please help me with following problem. > > I have created a Sql table in SQl express but I want to create a drop down > list directly in one of the columns in the sql database so that I can see the > drop down list when I load my c# datagrid. Whats the best way of going about > this. > > Thanks for any help.... > Have a look at http://support.microsoft.com/kb/319076 (HOW TO: Extend the Windows Form DataGridTextBoxColumn to Display Data From Other Tables by Using Visual C# .NET) It is also available for VB: http://support.microsoft.com/kb/319082 (HOW TO: Extend the Windows Form DataGridTextBoxColumn to Display Data From Other Tables by Using Visual Basic .NET) Regards, Peter