Gridview ,Inner join query.Bind to label ,stored procedure -sql

Posted by Raja_89 under ASP.NET on 5/17/2017 | Points: 10 | Views : 179 | Status : [Member] | Replies : 1
Hai

I am having an sp which returns a returns from more than one table

How can i bind that value to gridview

Example:

A field in that sp
(src.id) as [ID#]

Vb.net

<asp:TemplateField HeaderText="City" ItemStyle-Width="150" ItemStyle-CssClass="txtBox lPad10 bdr" ItemStyle-Height="28" HeaderStyle-CssClass="GridHeader">

<ItemTemplate>
<asp:Label ID="lblid" runat="server" Text='<%# Eval("src.id")%>' CssClass="control-label"></asp:Label>
</ItemTemplate>
</asp:TemplateField>

if i proceed shows an error msg "DataBinding: 'System.Data.DataRowView' does not contain a property with the name 'src.id'." and in gridview

Regards




Responses

Posted by: Jitendrasoft09 on: 6/10/2017 [Member] [MVP] Starter | Points: 25

Up
0
Down
You are missing out src.id in your gridview data source. Try to map it with lblid item template or change item accordingly.

Jitendra Kumar
If my post helps you, plz mark as an answer.

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

Login to post response