Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default DataRowView

    Hi all,

    I have got this error when using "DataRowView". Do we
    need to put reference to this class somewhere? Or Could
    you please point out What is wrong with this HTML?
    Thanks

    ----------------------------------------------------------

    Compiler Error Message: CS0246: The type or namespace
    name 'DataRowView' could not be found (are you missing a
    using directive or an assembly reference?)

    Source Error:



    Line 78:
    </ItemTemplate>
    Line 79:
    <EditItemTemplate>
    Line 80:
    <asp:DropDownList runat="server"
    SelectedIndex='<%# StateIndex[(String)((DataRowView)
    Container.DataItem)["state"]] %>' id="edit_State">
    Line 81:

    <asp:ListItem>CA</asp:ListItem>
    Line 82:

    <asp:ListItem>IN</asp:ListItem>
    ----------------------------------------------------------
    It is a dropdown list using in the datagrid control as
    follows:


    <EditItemTemplate>

    <asp:DropDownList runat="server"
    SelectedIndex='<%# StateIndex[(String)((DataRowView)
    Container.DataItem)["state"]] %>' id="edit_State">

    <asp:ListItem>CA</asp:ListItem>

    <asp:ListItem>IN</asp:ListItem>

    <asp:ListItem>KS</asp:ListItem>

    <asp:ListItem>MD</asp:ListItem>

    <asp:ListItem>MI</asp:ListItem>

    <asp:ListItem>OR</asp:ListItem>

    <asp:ListItem>TN</asp:ListItem>

    <asp:ListItem>UT</asp:ListItem>

    </asp:DropDownList>

    </EditItemTemplate>
    ---------------------------------------------------------


    Dinky Guest

  2. Similar Questions and Discussions

    1. DataRowView - deleting rows: A little quiz -or- Why doesn't this work...
      Can anyone please tell me what is wrong with the following code: I have a datagrid showing data from in a DataView. The following code snippet...
    2. Dynamic Table Build Using DataRowView
      All I'm trying to build a table dynamically from a DataView using IEnumerator. It will be read only data for printing on Avery 5160 label...
    3. BC30002: Type 'DataRowView' is not defined.
      Hi I get this error when I try to run my Page which has nested DataGrid. <asp:DataGrid id=DataGrid2 runat="server" AutoGenerateColumns="False"...
    4. DataRowView problem
      The problem is... I can't seem to use them. When I try to declare one, I get: Compiler Error Message: BC30002: Type 'DataRowView' is not defined....
    5. Why do I have to qualify 'DataRowView' with System.Data?
      I am getting the error below when I try to use DataRowView in my aspx page. I am using the System.Data in my code behind. I even tried importing...
  3. #2

    Default Re: DataRowView

    do you have a namespace reference to System.Data?

    "Dinky" <dinh.nguyen@dewr.gov.au> wrote in message
    news:07ac01c3467a$29069ec0$a301280a@phx.gbl...
    > Hi all,
    >
    > I have got this error when using "DataRowView". Do we
    > need to put reference to this class somewhere? Or Could
    > you please point out What is wrong with this HTML?
    > Thanks
    >
    > ----------------------------------------------------------
    >
    > Compiler Error Message: CS0246: The type or namespace
    > name 'DataRowView' could not be found (are you missing a
    > using directive or an assembly reference?)
    >
    > Source Error:
    >
    >
    >
    > Line 78:
    > </ItemTemplate>
    > Line 79:
    > <EditItemTemplate>
    > Line 80:
    > <asp:DropDownList runat="server"
    > SelectedIndex='<%# StateIndex[(String)((DataRowView)
    > Container.DataItem)["state"]] %>' id="edit_State">
    > Line 81:
    >
    > <asp:ListItem>CA</asp:ListItem>
    > Line 82:
    >
    > <asp:ListItem>IN</asp:ListItem>
    > ----------------------------------------------------------
    > It is a dropdown list using in the datagrid control as
    > follows:
    >
    >
    > <EditItemTemplate>
    >
    > <asp:DropDownList runat="server"
    > SelectedIndex='<%# StateIndex[(String)((DataRowView)
    > Container.DataItem)["state"]] %>' id="edit_State">
    >
    > <asp:ListItem>CA</asp:ListItem>
    >
    > <asp:ListItem>IN</asp:ListItem>
    >
    > <asp:ListItem>KS</asp:ListItem>
    >
    > <asp:ListItem>MD</asp:ListItem>
    >
    > <asp:ListItem>MI</asp:ListItem>
    >
    > <asp:ListItem>OR</asp:ListItem>
    >
    > <asp:ListItem>TN</asp:ListItem>
    >
    > <asp:ListItem>UT</asp:ListItem>
    >
    > </asp:DropDownList>
    >
    > </EditItemTemplate>
    > ---------------------------------------------------------
    >
    >

    Benjie Fallar Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139