By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

Populate dropdown list

P: n/a
How can I populate a dropdownlist with data from a database using
Microsoft.ApplicationBlocks.Data ?
Thanks


Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <ma********@comcast.net> wrote in message
news:ug**************@TK2MSFTNGP10.phx.gbl...
How can I populate a dropdownlist with data from a database using
Microsoft.ApplicationBlocks.Data ?
Thanks

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.