Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Populate dropdown list

Reply
Thread Tools

Populate dropdown list

 
 
Mark Goldin
Guest
Posts: n/a
 
      07-24-2004
How can I populate a dropdownlist with data from a database using
Microsoft.ApplicationBlocks.Data ?
Thanks




 
Reply With Quote
 
 
 
 
Jeffrey Palermo [MCP]
Guest
Posts: n/a
 
      07-26-2004
Use one of the SqlHelper methods. For instance, SqlHelper.ExecuteDataSet(.
.. .), and then just map the DataSource = returnedDataSet.Tables[0];, and
then you can set which field for the text and the value. All the
applications blocks do is encapsulate the ado.net call, so instead of
creating your connection object, then command object and executing the
command to return something, you call a static method of SqlHelper passing
in a connection string or connection or transaction object, the query or
stored procedure to run, some other potential options, and you'll get a
result back.

I have wrapped the Data Access application block in my own class that, upon
instantiation, creates a connection from the connection string stored in my
config file, and then it's ready to exectue anything. On Dispose() of my
object, I close my connection.

Best regards,
Jeffrey Palermo

"Mark Goldin" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> How can I populate a dropdownlist with data from a database using
> Microsoft.ApplicationBlocks.Data ?
> Thanks
>
>
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate 2nd dropdown list based on selecteditem in first with out postback? Vinay ASP .Net 2 08-18-2005 06:15 PM
Populate DropDown list at run-time John Beschler ASP .Net Web Controls 3 08-12-2005 12:36 PM
Populate a dropdown list with a variable from a Querystring Jim via DotNetMonster.com ASP .Net 2 02-24-2005 06:25 AM
How to populate dropdown list from database? =?Utf-8?B?TWVyZGFhZA==?= ASP .Net 3 10-20-2004 06:15 PM
Edit Mode - How do I populate dropdown in edittemplate from dropdown in another column? Steve Myers ASP .Net Datagrid Control 2 11-20-2003 01:09 PM



Advertisments