Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

label binding trouble

$
0
0
Hey Guys...So i'm attempting to use a label to display a record I have stored in a table in the DB. There is only one record in this table.

//declare class at top of page


     protected Invoice invoice_Info;
    
       myDataBase db = new myDataBase();
            
       invoice_Info =
                (from invoiceInfo in db.Invoice_Infos
                 select invoiceInfo).FirstOrDefault();
            
                    labelBindforInvoiceDetails.DataBind();


Then in my aspx page I am using:

    <span>                             
     <asp:Label id="labelBindforInvoiceDetails" runat="server" Text="<%# Bind('invoice_Info') %>"/>                                  
     </span>



But the code is throwin me an error with 'bind' Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>