Solved

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

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …

732 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