473,387 Members | 1,650 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,387 software developers and data experts.

how to show mine text in datalist while NULL in store in databse table

hello guys,
pls solve my problem
my problem is that
i m retreive data from table but in some column the value is store NULL. i want that insist of NULL it wl display some text in datalist while data retreive from databse

Eg.
employee //table name

Date //column name

14/6/82
NULL
15/6/82

i want display it in this format

employee //table name

Date //column name

14/6/82
Date Not Filled
15/6/82

is it possible if yes then send me solution of this problem with the help of example.
thanks
Apr 28 '07 #1
2 1685
debasisdas
8,127 Expert 4TB
Text1.Text = IIf(Not IsNull(rs(0)), "data not found",rs(0))



rest i think u can modify


if using vb.net try ISDBNULL incase of ISNULL




Hope that works for you
Apr 28 '07 #2
i m using this query for checking NULL value
<%# DataBinder.Eval(Container.DataItem,"promotiondue") == DBNull.Value.ToString() ? "Date not filled" : DataBinder.Eval(Container.DataItem,"promotiondue") %>

but it is not work they r giving error : BC30201: Expression expected


in asp.net i m not using dataset and adapter

my way to execute query is:

sql = "workstation id=IASRI-A51B8POSU;user id=sa;data source = permisnet;initial catalog=permisnet_new;database=Permisnet_new"
objConnect = New SqlConnection(sql)
objConnect.Open()
command = "Select * From personnel "
objCommand = New SqlCommand(command, objConnect)

datalist.DataSource = objCommand.ExecuteReader
datalist.DataBind()
'varReader.Close()
objConnect.Close()

now tell me the solution if u knw


Text1.Text = IIf(Not IsNull(rs(0)), "data not found",rs(0))



rest i think u can modify


if using vb.net try ISDBNULL incase of ISNULL




Hope that works for you
May 1 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: lydia sista via DotNetMonster.com | last post by:
hi! help... How do you show/hide item's data? Like sale item on product catalogue. I want to show the sale image when the status of product is on sale. in my catalogue I use datalist:...
0
by: fig000 | last post by:
Hi, I have a datalist with bound data from a database. If I wanted to access one of the fields I would normally use the itemdatabound event to access that field on each row. However in this...
1
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.