-
ASP blank fields
I notice that on my webpage: when I check if a field in a database is not blank then I write the Item out else I write the word "None".
I use this for various fields on my page. The problem is that when the field is not blank it won't write the field out.
Can someone tell me what I'm doing wrong.
This is how my code looks
<% if qryEmp(middlename) <> "" then response.write qryEmp(middlename) else response.write "None" end if %>
-
Re: ASP blank fields
Your problem is that the database field is not blank, it is null... what you
need to do is convert the null values to an empty string when doing your
comparison. Try this code:
<%if qryEmp(middlename) & "" <> "" then
response.write qryEmp(middlename)
else
response.write "None"
end if %>
Jake Duckworth
vero <c_vero00@yahoo.com> wrote:
>I notice that on my webpage: when I check if a field in a database is not
blank then
>I write the Item out else I write the word "None".
>
>I use this for various fields on my page. The problem is that when the
field is not
>blank it won't write the field out.
>
>Can someone tell me what I'm doing wrong.
>
>This is how my code looks
><% if qryEmp(middlename) <> "" then response.write qryEmp(middlename) else
response.write
>"None" end if %>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks