Ask a Question related to ASP.NET General, Design and Development.
-
Sonali.NET[MVP] #1
Re: bind drop down list
'Code to populate datareader
'...
while dataread.read()
ddl.items.add(new listitem(dataread("StudentName").ToString , dataread("StudentID").ToString))
end while
HTH
----- Original Message -----
From: "Julia" <pauldiamond@ukonline.co.uk>
Newsgroups: microsoft.public.dotnet.framework.aspnet
Sent: Sunday, July 13, 2003 12:27 PM
Subject: bind drop down list
> I am just starting .net and am looking for an example of binding a
> dropdown(combo) to an sql server database.
>
> I want the dropdown to be populated with StudentName in the text and
> StudentID in the value.
>
> Because I only need to read the data I think I should be using the
> datareader but am not sure.
>
> Thankyou
>
>
>Sonali.NET[MVP] Guest
-
Drop Down List??
Hi I am working for a non-profit meaning we have to create our own website without using a penny, I really have no clue what I am doing so this... -
about drop down list box
i got two drop downlists when i select an item in dropdown list 1 the dropdown list 2 should be populated with the corresponding items from the... -
drop down list and ASP.NET
Hi, I created an ASP.NET dropdown list and populated the list from an Access database via the Dreamweaver data set and ASP dropdown list... -
How to bind to a drop down list in a grid.
I want to display some drop down lists in a grid. Let's say user Joe is from Region 1, and I want to get a list of users and bind to the grid, but... -
Dynamical populating a list that can be used as drop down list
Hi, I have a solution in which a person can be a member of one or more groups. In this case the groups are those used in the protection schema of... -
Jos #2
Re: bind drop down list
Julia wrote:
[url]http://msdn.microsoft.com/library/en-us/dv_vbCode/html/vbtskCodePopulatingDr[/url]> I am just starting .net and am looking for an example of binding a
> dropdown(combo) to an sql server database.
>
> I want the dropdown to be populated with StudentName in the text and
> StudentID in the value.
>
> Because I only need to read the data I think I should be using the
> datareader but am not sure.
>
> Thankyou
opDownListOrListBoxControlUsingDataReaderVisualBas ic.asp
(remove linebreaks)
For the Dropdownlist, set DataTextField="StudentName" and
DataValueField="StudentID"
--
Jos Branders
Jos Guest



Reply With Quote

