473,786 Members | 2,638 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;

dsVendorContact s is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContact s
.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 1399
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***@optonlin e.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;

dsVendorContact s is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContact s
.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?

dsVendorContact s is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dsVendorContact s.Tables("wwVen dors").DefaultV iew
.Sort = "LastName ASC"
.AllowNew = False
End With

With dgVendors
.DataSource = dsVendorContact s
.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******** ******@TK2MSFTN GP05.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***@optonlin e.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;

dsVendorContact s is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContact s
.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***@optonlin e.net> schreef in bericht
news:Xn******** *************** ********@207.46 .248.16...
Hi Cor!

So then, using my previous example, would I?

dsVendorContact s is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dsVendorContact s.Tables("wwVen dors").DefaultV iew
.Sort = "LastName ASC"
.AllowNew = False
End With

With dgVendors
.DataSource = dsVendorContact s
.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******** ******@TK2MSFTN GP05.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***@optonlin e.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;

dsVendorContact s is a DataSet with three tables and relational links
dgVendors is a DataGrid

With dgVendors
.DataSource = dsVendorContact s
.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.DataS ource = dsVendorContact s.Tables("wwVen dors").DefaultV iew

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 to you reference the value of a column in a data table/view from the row filter string of a different data view. I'm using a strongly typed dataset. Below is more info.
2
1491
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 = Array.CreateInstance(GetType(DataView), 10)
1
1312
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 either!! :'( now that my rant is over, here is my question: i have applied 2 dataviews on a datatable. now i want to iterate thru this dataview to see the underlying values. the views are being
4
1738
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 objects to the frist few forms but then later I removed those and created these objects in my code. I now see 3 datasets in the Solution Explorer panel part but not all the datasets that I have in my codes. Are these 3 datasets leftover from the...
4
1629
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
1904
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 specifically focus about that I was using dataviews and just datagrids. Ken Tucker was nice enough to share an example using datagrids and relations/constraints from code (thanks ken). I was able to duplicate this example using components and...
0
1050
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 fairly complicated and contains many tables and many relationships What we would like to do is create a DataView that flattens the in
12
3604
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 gridview, for example, I loop through a datareader, populating an array list with instances of a custom class in the middle tier, and then send the array list up to the presentation layer and bind the gridview to it. If I use a typed dataset, I...
0
1109
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 time. Nowadays, however, it seems that the modern languages like Java and C# steer you towards working with data in a 'disconnected' fashion, i.e. loading records into datatables and datasets then using dataviews to look at them how you like. ...
0
9650
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10110
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7515
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5398
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4067
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 we have to send another system
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.