473,320 Members | 1,799 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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>
---------------------------------------------------------
Nov 17 '05 #1
2 6369
do you have a namespace reference to System.Data?

"Dinky" <di*********@dewr.gov.au> wrote in message
news:07****************************@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>
---------------------------------------------------------

Nov 17 '05 #2
simple fix, where you have

StateIndex[(String)((DataRowView)
Container.DataItem)["state"]]

change to StateIndex[(String)((System.Data.DataRowView)
Container.DataItem)["state"]]

adding System.Data. to the front of the DataRowView.
Apr 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John Hoge | last post by:
I have a datagrid that needs to display information from a related table, and I have use a template column to pass the Container.DataItem object to a method called ShowPub as follows: ...
1
by: VMI | last post by:
I have a field in my DataRowView that's read-only because it's a "join" of several other fields of the same DataRowView. For example, the field "Input" concatenates fields "Addr1", "City", "St",...
5
by: karim | last post by:
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 system.Data in the aspx. I have to qualify it with...
1
by: Guoqi Zheng | last post by:
Dear Sir, I need to access the datasource of a repeater control. I used CType(e.Item.DataItem, DataRowView), but obviously it does not work. Can some one tell me what I did wrong? See my...
7
by: Able | last post by:
Dear friends I am using FindRows methods of the DataView to select multiple rows as this: Dim custView As DataView = New DataView(custDS.Tables("Customers"), "", _ "CompanyName, ContactName",...
2
by: Geoff Jones | last post by:
Hi Suppose I have a loop such as: For Each x As DataRowView In dataViewObj ' Some calculations go here Next Suppose we to access within the loop not only the current row but the next one...
2
by: Frank | last post by:
Hi, I want to put a datarowview aside to use later on. How? dim curRow as datarowview dim oldRow as datarowview oldrow=currow doesn't do the trick because I save the object ref and oldrow...
2
by: Joe | last post by:
Hello All: How have you used the DataRowView. I am familiar w/ DataRow (of course!), but haven't had the need to use the DataRowView. When would you use it? Thanks. Joe
0
by: rockdale | last post by:
private void dgrid_OnItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) { if(e.Item.ItemType ==ListItemType.Item||e.Item.ItemType ==ListItemType.AlternatingItem)...
3
by: needin4mation | last post by:
In this code: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView rowView =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.