Datareader binding

Results 1 to 2 of 2

Thread: Datareader binding

  1. #1
    Join Date
    Dec 1969

    Default Datareader binding

    Can you bind a data reader to 2 dropdown lists say in one go as below? I have tried it, but does not seem to work, but not sure if I am doing it correctly, so populating the data reader twice to bind to the dropdown but wondering about a performance hit this way as having to run the SQL query twice. <BR><BR>cboLang.DataSource = objDataReader<BR>cboLang.DataValueField = "Language Code"<BR>cboLang.DataTextField = "Language Name"<BR> <BR>cboLang.DataBind()<BR><BR>cboFLang.DataBind()? ???<BR><BR>Thanks in advance

  2. #2
    Join Date
    Dec 1969

    Default RE: Datareader binding

    I think that you would have to do something like <BR><BR>cboLang.DataSource = objDataReader<BR>cboLang.DataValueField = "Language Code"<BR>cboLang.DataTextField = "Language Name"<BR><BR>cboLang.DataBind()<BR><BR>and then <BR><BR>cboFLang.DataSource = objDataReader<BR>cboFLang.DataValueField = "Language Code"<BR>cboFLang.DataTextField = "Language Name"<BR>cboFLang.DataBind()<BR><BR>but as long as the datareader is not closed then i don&#039;t see why it shouldn&#039;t work..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts