//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.