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
Then in my aspx page I am using:
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.
//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.