This is a discussion on How to remove empty or null rows from a dataview within the C# Programming forums, part of the Software Development category; When I try to remove the row that coming back empty or null it removes all the data for that ...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| When I try to remove the row that coming back empty or null it removes all the data for that segment and not just the row. DataSet myDataSet = new DataSet();DataView myDataView = new DataView(); myDataSet = db.ExecuteDataSet(command); myDataView = myDataSet.Tables[0].DefaultView; foreach (DataRow dr in myDataView.Table.Rows) { if (dr.IsNull("certifications")) dr.Delete(); } return myDataView; <asp:Repeater ID="Repeater1" runat="server" > <ItemTemplate> <table cellpadding="10"> <tr> <td align="left" width="10%" valign="middle"> <asp:HyperLink ID="Image9" NavigateUrl='<%# DataBinder.Eval(Container.DataItem, "resume_link") %>' ImageUrl='<%# DataBinder.Eval(Container.DataItem, "image_link") %>' runat="server" /></td> <td align="left" width="100%" valign="middle"> <asp:Label ID="lblformal_name" CssClass="KPMainTeam" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "formal_name") %>'></asp:Label><br /> <asp:Label ID="lblcertifications" CssClass="KPMainTeam" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "certifications") %>'></asp:Label><br /> <asp:Label ID="lbltiltle" CssClass="KPMainTeam" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>'></asp:Label></td> </tr> </table> </ItemTemplate> </asp:Repeater> |
| Sponsored Links |
| |||
| Hi Wily.... What do you mean it removes the segment? What segment are you referring to?
__________________ The OXYGEN Delivers edgy, intelligent Technology to all... |
| |||
| DataSet myDataSet = new DataSet(); DataView myDataView; myDataSet = db.ExecuteDataSet(command); myDataView = myDataSet.Tables[0].DefaultView; //apply a row filter myDataView.RowFilter = "not (certifications is null)"; |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Convert Dataview to Datatable | it.wily | C# Programming | 2 | 01-23-2008 02:51 AM |
| What is the result of comparing NULL with NULL? | vijayanand | Database Support | 1 | 09-20-2007 07:07 AM |
| NULL Pointer and a NULL Macro | vigneshgets | C and C++ Programming | 3 | 09-08-2007 03:24 AM |
| Empty a recycle bin in C# | garunprasad | C# Programming | 2 | 08-25-2007 02:56 AM |
| what is the Difference between isset() and empty() . | raj | PHP Programming | 2 | 07-19-2007 01:03 AM |