c# - i m getting Error in in Repeater with in Repeater in Data Source -
<b><%# databinder.eval(container.dataitem, "hotel_floorid")%></b> <b><%# databinder.eval(container.dataitem, "hotel_floorname")%></b> <br> <asp:repeater id="childrepeater" runat="server" datasource='<%# ((datarowview)container.dataitem).row.getchildrows ("myrelation") %>' > <itemtemplate> <%# databinder.eval(container.dataitem, "[\"roomdoorno\"]")%><br> </itemtemplate> </asp:repeater> </itemtemplate>
protected void page_load(object sender, eventargs e) { string css = configurationmanager.connectionstrings["cs"].connectionstring; sqlconnection cnn = new sqlconnection(css); cnn.open(); sqldataadapter cmd1 = new sqldataadapter("select * hm_hotel_floor", cnn); dataset ds = new dataset(); cmd1.fill(ds, "floors"); parentrepeater.datasource = ds.tables["floors"]; sqldataadapter cmd2 = new sqldataadapter("select * hm_rooms", cnn); cmd2.fill(ds, "rooms"); ds.relations.add("myrelation", ds.tables["floors"].columns["hotel_floorid"], ds.tables["rooms"].columns["hotel_floorid"]); page.databind(); }
the error compiler error message: cs0246: type or namespace name 'datarowview' not found (are missing using directive or assembly reference?)
please 1 me
code-behind (.cs) , page (.aspx) files have own classes have separate imports too. in case missing import on top of aspx view:
<%@ import namespace="system.data" %>
this required because casting container.dataitem datarowview in aspx view.
in addition make sure have using statement in code-behind file well:
using system.data;
Comments
Post a Comment