Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2007-03-22
2
Medium Priority
?
580 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 2000 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

705 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