how to bind the label to gridview
when that mobile value is null from database then that label is not display or not bind to gridview
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Dorababu MekaPosted Jan 16, 2013, 6:32 AM
Dorababu MekaPosted Jan 12, 2013, 3:54 AM
in place of call add your database column name
prathyushaPosted Jan 4, 2013, 6:58 AM
Santhosh Kumar JayaramanPosted Jan 4, 2013, 6:48 AM
set Mobile=NULL
where mobile='null'
prathyushaPosted Jan 4, 2013, 6:44 AM
it's not working in my database mobile is null and mobile datatype is
nvarchar(255) and i changed null to NULL it is also not working
Santhosh Kumar JayaramanPosted Jan 4, 2013, 5:30 AM
Either update your column to Null instead of 'null'
or in label change the condition to "null" as below.
prathyushaPosted Jan 4, 2013, 4:17 AM
please help me
Santhosh Kumar JayaramanPosted Jan 4, 2013, 4:10 AM
Try this
prathyushaPosted Jan 4, 2013, 4:07 AM
here i'm ataching two rar files please chek it and send me the code
Santhosh Kumar JayaramanPosted Jan 4, 2013, 2:46 AM
prathyushaPosted Jan 4, 2013, 2:43 AM
Santhosh Kumar JayaramanPosted Jan 4, 2013, 2:22 AM
this should be working..I have attached a sample project in which am setting mobile property to Null . And in the visible am checking for ==null. now call label is not displayed for me.
In your case, if your getting Dbnull, then compare with Dbnull.Value instead of null in my code.
I attached sample project. run it and check the difference.
prathyushaPosted Jan 4, 2013, 1:56 AM
prathyushaPosted Jan 4, 2013, 1:30 AM
But i want to use the label text is static like
based on that call value from database it display or not like
if CALL:NULL it doesn't display in gridview(with call also not display i mean static text)
if CALL:9874563210 it bind to the gridview or display
Please help me
Santhosh Kumar JayaramanPosted Jan 3, 2013, 4:46 AM
Try this
Neha SharmaPosted Jan 3, 2013, 3:08 AM
you can mention text of label like Text='<%# Bind("OriginCIType_ID") %>' or can take it in columns -> aspboundfields like:
prathyushaPosted Jan 3, 2013, 12:26 AM
Santhosh Kumar JayaramanPosted Jan 3, 2013, 12:17 AM
prathyushaPosted Jan 3, 2013, 12:16 AM
i am attached the output file in that where call:null is not display because the call value is null
when call has value that would be bind to gridview so please check it once and send me the code
prathyushaPosted Jan 2, 2013, 11:52 PM
Santhosh Kumar JayaramanPosted Jan 2, 2013, 7:52 AM
public string ProcessMyDataItem(object myValue)
{
if (myValue == null)
{
return "0 value";
}
return myValue.ToString();
}