Solved

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

Posted on 2007-03-22
2
566 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
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now