Mike,
Just a thought..... and I am not quite and ASP.NET expert but Doesn't db null usually require some db action. What if you were to create the function with (by val company as string) And query the data base in that function.... Maybe not the most efficient way but it would work In the function you could put PSEUDO CODE.... If NameOfDatabase or Recordset is not dbnull then Blah!!! Else Blah!!! ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Mike Appenzellar Sent: Monday, December 05, 2005 2:59 PM To: [email protected] Subject: [AspNetAnyQuestionIsOk] sending null value to function...but not always I have a repeater. In that repeater a certain value may or not be null. My problem is I need to send the repeater value into a function, if there is a value display it otherwise display nothing. Problem is, works if I cast to DBNULL but only if the item really is null. The code is below which might help. ------------------------------------------------ <table width="100%"> <asp:Repeater id="customer" runat="server"> <ItemTemplate> <tr> <td class="body"> <strong> <%# Container.DataItem("name")%><br> <%# isThereCompany(Container.DataItem("company")) %> ------AN EXAMPLE WHERE THE PROBLEM LIES. I COULD JUST DISPLAY THIS IN NORMAL CONTAINER BUT I DON'T WANT THE "<BR>" <%# Container.DataItem("billing_address")%><br> <%# Container.DataItem("billing_city")%>, <%# Container.DataItem("billing_state")%> <%# Container.DataItem("billing_zip")%><br><hr><br> E-Mail: <%# Container.DataItem("email")%><br> Phone: <%# Container.DataItem("phone")%><br><hr><br> <%# isThereShip(Container.DataItem("shipping_address"), Container.DataItem("shipping_city"), Container.DataItem("shipping_state"), Container.DataItem("shipping_zip")) %> Card Issuer: <%# Container.DataItem("cc_type")%><br> Name on card: <%# Container.DataItem("cc_name")%><br> Credit Card #: <%# Container.DataItem("cc_number")%><br> Exp Date: <%# Container.DataItem("cc_exp")%><br> V-Code: <%# Container.DataItem("cc_vcode")%><br><hr><br> <%# isThereHowHear(Container.DataItem("how_hear")) %> <%# isThereComments(Container.DataItem("comments")) %> </strong> </td> </tr> </ItemTemplate> </asp:Repeater> </table> ------------------------------------------------ CODE BEHIND: ' IF I CAST THIS AS STRING, IT ERRORS IF THERE IS NO VALUE, BUT IT WORKS IF THERE IS NO VALUE Public Function isThereCompany(ByVal strValue As DBNull) Dim strTest As String If Not strValue Is DBNull.Value Then strTest = strValue & "<br>" Return strValue Else strTest = "<br>" Return strTest End If End Function [Non-text portions of this message have been removed] SPONSORED LINKS Basic programming language <http://groups.yahoo.com/gads?t=ms&k=Basic+programming+language&w1=Basic +programming+language&w2=Computer+programming+languages&w3=Programming+l anguages&w4=Java+programming+language&c=4&s=126&.sig=bnac3LCZpttb3c9FvbV U-A> Computer programming languages <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=B asic+programming+language&w2=Computer+programming+languages&w3=Programmi ng+languages&w4=Java+programming+language&c=4&s=126&.sig=1Czd2hKCO9_u4KV ZQperFQ> Programming languages <http://groups.yahoo.com/gads?t=ms&k=Programming+languages&w1=Basic+prog ramming+language&w2=Computer+programming+languages&w3=Programming+langua ges&w4=Java+programming+language&c=4&s=126&.sig=TyHGCjod4YOKITrSq1xccQ> Java programming language <http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=Basic+ programming+language&w2=Computer+programming+languages&w3=Programming+la nguages&w4=Java+programming+language&c=4&s=126&.sig=PZAexF9LyXpKb3HDJSlB 1g> ________________________________ YAHOO! GROUPS LINKS * Visit your group "AspNetAnyQuestionIsOk <http://groups.yahoo.com/group/AspNetAnyQuestionIsOk> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED] cribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/saFolB/TM --------------------------------------------------------------------~-> Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
