Solved

Get a DataRow from a DataView--Import from one DataSet to another

Posted on 2007-03-22
2
578 Views
Last Modified: 2007-03-22
In VB .NET 2003, I want to import several records from one DataSet to another. I can easily isolate the records I want using a .RowFilter on a DataView, but I can't figure out how to import the results to the second DataSet, because .ImportRow wants a DataRow as input, and a DataView structures its results as DataRowView. Trying to do a CType(drview, DataRow) gives an error. I'm sure there must be something simple I'm missing, but I have no idea what the process would be.

(If there's a better way to select the proper records from the first dataset, I'm up for that, though I wouldn't mind understanding DataView usage a bit better in any case.)
0
Comment
Question by:ElrondCT
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

Accepted Solution

by:
Sancler earned 500 total points
ID: 18775957
A DataRowView has a .Row property, which returns a DataRow: that is, the relevant DataRow from the DataTable on which the DataView is based.

Another way would be to use .Select on the DataTable itself, with text similar to that you would use in DataView.RowFilter.

Roger
0
 
LVL 20

Author Comment

by:ElrondCT
ID: 18776976
Thanks, Roger. I figured it had to be something straightforward, but there are so many nooks and crannies to look in for properties!
0

Featured Post

Want Experts Exchange at your fingertips?

With Experts Exchange’s latest app release, you can now experience our most recent features, updates, and the same community interface while on-the-go. Download our latest app release at the Android or Apple stores today!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

622 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question