473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

If Expression!

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
Nov 19 '05 #1
2 969
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
"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:OI**************@TK2MSFTNGP10.phx.gbl...
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

Nov 19 '05 #2
Pat
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

"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:uF**************@TK2MSFTNGP15.phx.gbl...
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
"Adam Knight" <ad**@pertrain.com.au> wrote in message
news:OI**************@TK2MSFTNGP10.phx.gbl...
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


Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Paul Rubin | last post by:
OK, I want to scan a file for lines matching a certain regexp. I'd like to use an assignment expression, like for line in file: if (g := re.match(pat, line)): croggle(g.group(1)) Since...
70
by: Roy Yao | last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ? According to my analysis, operator sizeof, (type) and * have the same precedence, and they combine from right to left. Then this...
22
by: Tony Johansson | last post by:
Hello Experts! I'm reading i a book about C++ and they mention infix with telling what it is. I hope you out there can do so. Many thanks! //Tony
2
by: Mike Turco | last post by:
I like using the expression builder for a lot of different things but it isn't always available when I want to use it, for example in the code window, or in all of the control properties. I am...
14
by: John Temples | last post by:
Given this code: extern volatile unsigned char v; int main(void) { v; return 0; }
15
by: Nerox | last post by:
Hi, If i write: #include <stdio.h> int foo(int); int main(void){ int a = 3; foo(a); }
7
by: Billa | last post by:
Hi, I am replaceing a big string using different regular expressions (see some example at the end of the message). The problem is whenever I apply a "replace" it makes a new copy of string and I...
1
by: lovecreatesbea... | last post by:
---quoting--- Annex C (informative) Sequence points 1 The following are the sequence points described in 5.1.2.3: - The end of a full expression: an initializer (6.7.8); the expression in an...
28
by: Marc Gravell | last post by:
In Linq, you can apparently get a meaningful body from and expression's .ToString(); random question - does anybody know if linq also includes a parser? It just seemed it might be a handy way to...
18
by: dspfun | last post by:
Hi! The words "expression" and "statement" are often used in C99 and C- textbooks, however, I am not sure of the clear defintion of these words with respect to C. Can somebody provide a sharp...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.