Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
SQL
ce
clients
clustering
connect
datamining
datawarehouse
dts
fulltext
jdbcdriver
msde
mseq
newusers
notificationsvcs
odbc
olap
programming
replication
reportingsvcs
security
securitytools
server
setup
sqlxml.viewmapper
tools
xml
  
 
date: Wed, 01 Oct 2008 22:04:33 GMT,    group: microsoft.public.sqlserver.server        back       


Creating a Drop down list in SQL express   
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
date: Wed, 01 Oct 2008 22:04:33 GMT   author:   markyjj via SQLMonster.com u45734@uwe

Re: Creating a Drop down list in SQL express   
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
date: Wed, 01 Oct 2008 19:32:44 -0400   author:   Roy Harvey (SQL Server MVP)

Re: Creating a Drop down list in SQL express   
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
date: Thu, 02 Oct 2008 01:39:42 +0200   author:   Peter Gibbons l

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us