|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
.DataBind will close a sqlDataReader??Any reason why?
I bind a DataReader to a DropDown and as soon as I execute the .DataBind() then IsClose becomes true. Is this because the DataReader is a one way street and when it has read thru the return results set it has no option other than to close? IDataReader's are forward only, read-only, data access objects. DataBinding
is going to read ever item and its data to its list. Since you can only go forward it stands to reason that there is no longer a reason to hold the connection to the data store open. Database connections (and other kinds of connections) are expensive. Holding a database connection open for any longer than necessary drastically effects (i.e. nosedive) the scalability of your application. Scalability is decreased because (1) typically database connections are pooled and their numbers are typically low, and (2) since they are typically low numbers your application could end up fighing with itself over this scarce resource. While the details of your requirements are skimpy from your email, it sounds like you are pulling back lookup info to populate the dropdowns, if possible either (prefered) cache that lookup info OR load it into an XML doc (not dataset) in the data access layer and bind that. Joe MCAD SRE (Simple Rule Engine) https://sourceforge.net/projects/sdsre/ Show quoteHide quote "Rob R. Ainscough" <roba***@pacbell.net> wrote in message news:uBjqoQxjFHA.3784@tk2msftngp13.phx.gbl... > Any reason why? > > I bind a DataReader to a DropDown and as soon as I execute the > .DataBind() then IsClose becomes true. Is this because the DataReader is > a one way street and when it has read thru the return results set it has > no option other than to close? > > >
Base Page Design Question
Which page load fires first? ASPX or ASCX? style width and height dynamic user control textbox is empty when accessing from aspx pag ByVal sender As Object, ByVal e As EventArgs - can I send more? How to create HTML controls a runtime GridView EmptyDataTemplate Question Parsing nested Tags Left Side menu control Bizarre - DataGrid inside HTML Table |
|||||||||||||||||||||||