473,499 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataViews with DataSets

I currently have a datagrid that I'm feeding with a DataSet, which contains
three tables. I would like to use a DataView to format the DataTables but
I'm not sure how to go about this.

Currently I have;

dsVendorContacts is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContacts
.DataMember = "wwVendors"
End With

If I create three DataViews, how do I attach the three seperate DataViews
to the grid and specify the main DataView?

Can I put DataViews into a DataSet?

Thanks,

Bernie
May 11 '06 #1
4 1378
Bernie,

Every datatable has one dataview.
The name of that is the defaultview.

The dataview is nothing more than a class that holds things as a rowfilter,
a sort property and a collection of references to the dataviewrows (which
all have again a reference to a datarow).

Therefore you cannot handle it as a real table.

I hope this helps,

Cor

"Bernie Hunt" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
I currently have a datagrid that I'm feeding with a DataSet, which contains
three tables. I would like to use a DataView to format the DataTables but
I'm not sure how to go about this.

Currently I have;

dsVendorContacts is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContacts
.DataMember = "wwVendors"
End With

If I create three DataViews, how do I attach the three seperate DataViews
to the grid and specify the main DataView?

Can I put DataViews into a DataSet?

Thanks,

Bernie

May 11 '06 #2
Hi Cor!

So then, using my previous example, would I?

dsVendorContacts is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dsVendorContacts.Tables("wwVendors").DefaultView
.Sort = "LastName ASC"
.AllowNew = False
End With

With dgVendors
.DataSource = dsVendorContacts
.DataMember = "wwVendors"
End With

And the sort and disallow would be in the grid when shown?

Sorry I'm away from my development station so I can't try out. It's
working on paper this morning.

Bernie
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in
news:uM**************@TK2MSFTNGP05.phx.gbl:
Bernie,

Every datatable has one dataview.
The name of that is the defaultview.

The dataview is nothing more than a class that holds things as a
rowfilter, a sort property and a collection of references to the
dataviewrows (which all have again a reference to a datarow).

Therefore you cannot handle it as a real table.

I hope this helps,

Cor

"Bernie Hunt" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
I currently have a datagrid that I'm feeding with a DataSet, which
contains
three tables. I would like to use a DataView to format the DataTables
but I'm not sure how to go about this.

Currently I have;

dsVendorContacts is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContacts
.DataMember = "wwVendors"
End With

If I create three DataViews, how do I attach the three seperate
DataViews to the grid and specify the main DataView?

Can I put DataViews into a DataSet?

Thanks,

Bernie



May 12 '06 #3
Bernie,

If I don't oversee something, yes.

Cor

"Bernie Hunt" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
Hi Cor!

So then, using my previous example, would I?

dsVendorContacts is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dsVendorContacts.Tables("wwVendors").DefaultView
.Sort = "LastName ASC"
.AllowNew = False
End With

With dgVendors
.DataSource = dsVendorContacts
.DataMember = "wwVendors"
End With

And the sort and disallow would be in the grid when shown?

Sorry I'm away from my development station so I can't try out. It's
working on paper this morning.

Bernie
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in
news:uM**************@TK2MSFTNGP05.phx.gbl:
Bernie,

Every datatable has one dataview.
The name of that is the defaultview.

The dataview is nothing more than a class that holds things as a
rowfilter, a sort property and a collection of references to the
dataviewrows (which all have again a reference to a datarow).

Therefore you cannot handle it as a real table.

I hope this helps,

Cor

"Bernie Hunt" <bh***@optonline.net> schreef in bericht
news:Xn*******************************@207.46.248. 16...
I currently have a datagrid that I'm feeding with a DataSet, which
contains
three tables. I would like to use a DataView to format the DataTables
but I'm not sure how to go about this.

Currently I have;

dsVendorContacts is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContacts
.DataMember = "wwVendors"
End With

If I create three DataViews, how do I attach the three seperate
DataViews to the grid and specify the main DataView?

Can I put DataViews into a DataSet?

Thanks,

Bernie


May 12 '06 #4
Bernie,

I once had a problem with that, so I use forever.

dgVendors.DataSource = dsVendorContacts.Tables("wwVendors").DefaultView

There is than no need to set the member.

cor
May 12 '06 #5

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

Similar topics

3
459
by: softengine | last post by:
Can and how do you alter a data view to include a look up field from another data table? The data table of the dataview only has the key, the value I need is in another data table. Can and how...
2
1463
by: Pablo | last post by:
Hi people, Necesito crear n dataviews en tiempo de ejecucion. I need to create "n" DataViews in runtime. I tried creating an array this way: Dim LDView As Array =...
1
1299
by: Vee Kay | last post by:
hi, this is my first post here. i'm in desparate need of resources for VC++.NET; the code in MSDN is only directed for VB/C#.. for C++ its very few and faar in between!! the web is no good...
4
1724
by: Alpha | last post by:
I have a small Window application and through out the different forms I create a different dataset. At the begining I used the Tools to drag and drop the SqlDataAdapter, connection and dataset...
4
1608
by: Bo Diddly | last post by:
This is what I've done so far: I have a DataBase with: tblBook BookID... key Book... All the book titles of the Bible tblChapter ChapterID... key Chapter... chapter numbers (1 - 150)
3
1880
by: Jerry | last post by:
Hi, I have a couple of datagrids that are based on dataviews. If I filter dataview1 I would like to automatically filter dataview2. I posted something about this before but I think I didn't...
0
1040
by: garethdjames | last post by:
For scalability we wish to use disconnected DataSets and hold them in the application cache. This means that multiple concurrent users will be reading the data (its read only) The DataSet is...
12
3550
by: BillE | last post by:
I'm trying to decide if it is better to use typed datasets or business objects, so I would appreciate any thoughts from someone with more experience. When I use a business object to populate a...
0
1095
by: kevin.jennings | last post by:
Hi! I'm an "old-school" programmer used to dealing with data one record at a time (using old RPG code like 'chain' and 'read' statements). I'm not used to dealing with huge chunks of data at one...
0
7174
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7220
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...
1
6894
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...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
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...
0
3099
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...
0
1427
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 ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
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...

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.