473,837 Members | 1,535 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

datarowview vs datarow

hey all,

DataRowView drv = (DataRowView)(( GridViewRow)lbl .NamingContaine r).DataItem;

i found this snippet on the net which works correctly in its context. It's
datasource is coming from a Typed DataSet.

Well, i modified the GridView's DataSource to use an UnTyped DataSet but i'm
getting an error saying
"Unable to cast object of type 'System.Data.Da taRow' to type
'System.Data.Da taRowView'.

Can someone please confirm why this is so? or if this makes any sense?

thanks,
rodchar
Jan 28 '08 #1
1 6209
sorry bout this, i had a brain cramp. the datasource was using a dataview of
the typed dataset. problem solved.

"rodchar" wrote:
hey all,

DataRowView drv = (DataRowView)(( GridViewRow)lbl .NamingContaine r).DataItem;

i found this snippet on the net which works correctly in its context. It's
datasource is coming from a Typed DataSet.

Well, i modified the GridView's DataSource to use an UnTyped DataSet but i'm
getting an error saying
"Unable to cast object of type 'System.Data.Da taRow' to type
'System.Data.Da taRowView'.

Can someone please confirm why this is so? or if this makes any sense?

thanks,
rodchar

Jan 28 '08 #2

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

Similar topics

1
6797
by: GeraldBauer | last post by:
I am experiencing some weird behaviors with the listbox and dataview. Here is a boiled down code snippet of what I am trying to do. <snippet> string MENUID = "MenuId" , ITEM = "Item" , MENU_ENTRY_ID = "MenuEntryId"; private void populateMenu() {
3
6108
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: <asp:TemplateColumn HeaderText="Publisher"> <ItemTemplate> <asp:Label Runat="server" Text='<%#ShowPub(Container.DataItem)%>' /> </ItemTemplate> </asp:TemplateColumn>
1
33396
by: ad | last post by:
What is the difference between DataRow and DataRowView?
1
1873
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", and "Zip", so I can't modify it. Is it possible to modify the properties of that particular field so that it can be written to? If not, can I copy that DataRowView into another DataRowView and then modify the field? The copy should be an exact copy,...
5
5174
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 System.Data to get it going. Why is that? Error Message: The type or namespace name 'DataRowView' could not be found (are you missing a using directive or an assembly reference?) Karim
2
1430
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 e.g. during the first loop x will be the first row, how can I access the
2
4322
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 changes with currow. Do I have to copy every item 1 by 1 or is there some neat trick?
2
671
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
3
15325
by: needin4mation | last post by:
In this code: protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { DataRowView rowView = (DataRowView)e.Row.DataItem; // Retrieve the value for the current row.
0
10578
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10631
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10276
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7813
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5670
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5851
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4477
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4049
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3126
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.