public member not found error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all. I really hope someone can help me solve this error:

I am getting the following error:

Public member 'PlanID' on type 'DataRowView' not found.

Here is the relevant code:

<ItemTemplate>
<tr>
<td background="images/ltMiddle.jpg" style="background-repeat:repeat-y;
background-position:top right;"> </td>
<td bgcolor="e1e1e1" style="background-repeat:repeat-y;
background-position:bottom;"> </td>
<td colspan="2" bgcolor="e1e1e1" style="background-repeat:repeat-y;
background-position:bottom;">
<asp:LinkButton id="Group1" CommandName="<%# container.DataItem().PlanID%>"
style="Z-INDEX: 101; LEFT: 328px; POSITION: absolute; TOP: 128px"
runat="server">LinkButton</asp:LinkButton>
</td>
<td background="images/rtMiddle.jpg" style="background-repeat:repeat-y;
background-position:top left;"> </td>
</tr>
</ItemTemplate>

The code is part of a Repeater control. The data is bound to the control in
the load procedure. Here is that code:

myConn.Open()

SelCmd.CommandText = "select planname,planid from floorplans
where squareft < 2000 order by planname ASC"
SelCmd.Connection = myConn
myCommand.SelectCommand = SelCmd

myCommand.Fill(FloorplansDs, "Under2kName")

FirstGroup.DataSource =
FloorplansDs.Tables("Under2kName").DefaultView
DataBind()

myCommand.Dispose()
myConn.Close()


Please help! :)
 
Hello all. I really hope someone can help me solve this error:

I am getting the following error:

Public member 'PlanID' on type 'DataRowView' not found.

Here is the relevant code:

<ItemTemplate>
<tr>
<td background="images/ltMiddle.jpg" style="background-repeat:repeat-y;
background-position:top right;"> </td>
<td bgcolor="e1e1e1" style="background-repeat:repeat-y;
background-position:bottom;"> </td>
<td colspan="2" bgcolor="e1e1e1" style="background-repeat:repeat-y;
background-position:bottom;">
<asp:LinkButton id="Group1" CommandName="<%# container.DataItem().PlanID%>"
style="Z-INDEX: 101; LEFT: 328px; POSITION: absolute; TOP: 128px"
runat="server">LinkButton</asp:LinkButton>
</td>
<td background="images/rtMiddle.jpg" style="background-repeat:repeat-y;
background-position:top left;"> </td>
</tr>
</ItemTemplate>

The code is part of a Repeater control. The data is bound to the control in
the load procedure. Here is that code:

myConn.Open()

SelCmd.CommandText = "select planname,planid from floorplans
where squareft < 2000 order by planname ASC"
SelCmd.Connection = myConn
myCommand.SelectCommand = SelCmd

myCommand.Fill(FloorplansDs, "Under2kName")

FirstGroup.DataSource =
FloorplansDs.Tables("Under2kName").DefaultView
DataBind()

myCommand.Dispose()
myConn.Close()

Please help! :)

Looks like your syntax is a bit off.

Try this instead

DataBinder.Eval(Container.DataItem,"PlanID")
 
Back
Top