How to pass storedprocedur to table?

Posted by Oswaldlily under ASP.NET on 8/23/2011 | Points: 10 | Views : 691 | Status : [Member] | Replies : 1
<asp:Table ID="tbl1" runat="server" BorderColor="Red" BorderWidth="1px"
CellPadding="2" CellSpacing="2" GridLines="Both" HorizontalAlign="Center">
<asp:TableRow ID="tblrow" runat="server">
<asp:TableCell ID="tblcell1" runat="server" Text='<%#Eval("Name") %>' HorizontalAlign="Right" Wrap="false"></asp:TableCell>
<asp:TableCell ID="tblcell2" runat="server" Text='<%#Eval("Unique ID") %>' HorizontalAlign="Right" VerticalAlign="Middle"></asp:TableCell>
</asp:TableRow>
</asp:Table>

now i need to pass my storedprocedure to this tableid..how its possible
tbl1.datasource=storedprocedure
tbl1.databind()

here table not acceptin datasource..hw to proceed




Responses

Posted by: Vuyiswamb on: 8/23/2011 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Up
0
Down
You need something we call a "gridview" and the data that is comming from the Storedprocedure need to be something like a Dataset or datatable.

http://www.dotnetfunda.com/articles/article1540-how-to-use-the-stored-procedure-in-adonet-.aspx

Thank you for posting at Dotnetfunda
[Administrator]

Oswaldlily, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response