Ok, using this(found the ".ToString" will deal with
null values query returns):

Dim drDefaults As OleDbDataReader =
cmd.ExecuteReader(System.Data.CommandBehavior.SingleRow)

drDefaults.Read()
txtEmail1.Text =drDefaults("Email1").ToString
txtEmail2.Text =drDefaults("Email2").ToString
txtEmail3.Text =drDefaults("Email3").ToString
txtEmail4.Text =drDefaults("Email4").ToString
txtEmail5.Text =drDefaults("Email5").ToString



--- Charles Carroll <[EMAIL PROTECTED]> wrote:

> 
> well a page gets rendered in phases.
> 
> page_init
> page_load
> page_onprerender
> page_render
> 
> <%#  %>
> happens way after page_load for many reasons (mostly
> at that time
> DataGrids, Repeaters and DataList will be filled up
> since they are
> empty during page_load) so not all other things on
> page may be able to
> see that textbox value in early phases of page
> execution since value
> is filled in much later.
> 
> Traccing gives you a little better idea that init,
> load, onprerender,
> etc. happen see
> http://www.learnasp.com/learn/debug1.aspx
> http://www.learnasp.com/learn/debug2.aspx
> 
> 
> 
> 
> On Sun, 16 Jan 2005 17:31:25 -0800 (PST), Karen
> Kungowski
> <[EMAIL PROTECTED]> wrote:
> >  Thank you Paul Ousterhout, Naweed Akram, Charles
> >  Carroll. (if it was a snake it would have bit
> me).
> >  
> >  By the way, what are the downside you using
> Naweed's
> >  method: <asp:TextBox ID="txtEmail1"
> runat="server"
> >  Text='<#
> >  strEmailTest %>'></asp:TextBox>
> >  
> >  
> >  Always grateful to this list,
> >  Karen
> > 
> >  
> >  
> >  --- Charles Carroll <[EMAIL PROTECTED]> wrote:
> >  
> >  > 
> >  > I recommend against that approach.
> >  > 
> >  > I was going to suggest it but it has several
> down
> >  > sides.
> >  > 
> >  > 
> >  > On Sun, 16 Jan 2005 22:24:34 +0300, Naweed
> Akram
> >  > <[EMAIL PROTECTED]> wrote:
> >  > >  Here is how it works:
> >  > >  
> >  > >  <asp:TextBox ID="txtEmail1" runat="server"
> >  > Text='<#
> >  > >  strEmailTest %>'></asp:TextBox>
> >  > >  
> >  > >  Regards
> >  > >  Naweed Akram
> >  > > 
> >  > >  
> >  > >  -----Original Message-----
> >  > >  From: Karen Kungowski
> >  > [mailto:[EMAIL PROTECTED] 
> >  > >  Sent: Sunday, January 16, 2005 10:07 AM
> >  > >  To: [email protected]
> >  > >  Subject: [AspNetAnyQuestionIsOk] Need to set
> >  > <asp:textbox> value with field
> >  > >  value
> >  > >  
> >  > >  
> >  > >  I've stuck the <%
> Response.Write(strEmailTest) %>
> >  > in
> >  > >  between the <asp:textbox> tags but it
> doesn't
> >  > work. It
> >  > >  is assumed that strEmailTest would hold the
> >  > results of
> >  > >  a query:
> >  > >        
> >  > >  <asp:TableCell>Email1<br><asp:TextBox
> >  > >  ID="txtEmail1" runat="server"><%
> >  > >  Response.Write(strEmailTest)
> >  > >  %></asp:TextBox></asp:TableCell>
> >  > >  
> >  > >  I have about 3 textboxes that I want to have
> >  > filled
> >  > >  with default values when the page loads.
> These
> >  > values
> >  > >  have to be drawn from a table. Classic ASP
> trick
> >  > >  doesn't work.
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >        
> >  > >              
> >  > >  __________________________________ 
> >  > >  Do you Yahoo!? 
> >  > >  Yahoo! Mail - You care about security. So do
> we. 
> >  > >  http://promotions.yahoo.com/new_mail
> >  > >  
> >  > >  
> >  > >  
> >  > >  Yahoo! Groups Links
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  
> >  > >  ________________________________
> >  > >  Yahoo! Groups Links
> >  > >  
> >  > > To visit your group on the web, go to:
> >  > >
> >  >
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >  > >   
> >  > > To unsubscribe from this group, send an email
> to:
> >  > >
> [EMAIL PROTECTED]
> >  > >   
> >  > > Your use of Yahoo! Groups is subject to the
> Yahoo!
> >  > Terms of Service.
> >  > 
> >  > 
> >  >  
> >  > Yahoo! Groups Links
> >  > 
> >  >
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >  > 
> >  >    
> >  >
> [EMAIL PROTECTED]
> >  > 
> >  >  
> >  > 
> >  > 
> >  > 
> >  > 
> >  
> >  
> >  
> >              
> >  __________________________________ 
> >  Do you Yahoo!? 
> >  Yahoo! Mail - Easier than ever with enhanced
> search. Learn more.
> >  http://info.mail.yahoo.com/mail_250
> >  
> >  
> >  Yahoo! Groups Sponsor 
> >  
> > ADVERTISEMENT
> >  
> >  
> >  
> >  ________________________________
> >  Yahoo! Groups Links
> >  
> > To visit your group on the web, go to:
> >
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> >   
> > To unsubscribe from this group, send an email to:
> > [EMAIL PROTECTED]
> >   
> > Your use of Yahoo! Groups is subject to the Yahoo!
> Terms of Service.
> 
> 
>  
> Yahoo! Groups Links
> 
> http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
> 
>    
> [EMAIL PROTECTED]
> 
>  
> 
> 
> 
> 



                
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to