If Expression!

  • Thread starter Thread starter Adam Knight
  • Start date Start date
A

Adam Knight

Hi all,

Having trouble with this expression.
Can anyone tell me what i am supposed to be doing?

If(Rdr("answer_url") <> System.DBNull.Value) Then
txtAnswerUrl.Text = Rdr("answer_url")
End If

Cheers,
Adam
 
Here is one solution i came up with.

txtAnswerUrl.Text = Rdr("answer_url").ToString() 'coverts to null string i
imagine

Should I be doing this when populating textboxes with db values?

Or is their a better i should be doing it, but haven't used yet?

Adam
 
Wouldn't it be better if you DataBind?
So far you want the values in Textboxes
<asp:TextBox cssclass="StdTextBox" Text='<%#
DataBinder.Eval(Container.DataItem, "Address") %>' runat=server>
And if u want it in Edit mode plug it in the EDITTEMPLATE
Hope that helps
Patrick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top