Maintaining relation between two tables when transferring records

dotnet framework

    Next

  • 1. dataviewmanager parent filter based on child criteria
    Hi, I've have an "Order / OrderDetails" parent child dataset. I have 2 datagrids. DataGrid1 is all of the orders. When I click on an orderdetail line I want DataGrid2 to show all orders using this part. Yes I could reselect the data from the database but why when I already have all the orders I care about in a dataset. I can create a datasetmanager: dim dvm as datasetmangager dvm = new datasetmanager(mydataset) dvm.dataviewsettings("orderdetails).rowfilter = "partno = '" & CurrentPartno.trim & "'" datagrid1.datasource = dvm Ok, now all is well and good for the orderdetails they don't show up in datagrid2. However, I still get all the parent rows with empty child rows when the child doesn't fit the filter.. I tried the following: dvm.dataviewsettings("order").rowfilter = "count(Child.partno) > 0" dvm.dataviewsettings("order").rowfilter = "Child.partno = '" & CurrentPartno.trim & "'" Neither works.
  • 2. Detecting Changes in Datagrid?
    How can I detect when changes are been made in the Datagrid? I don't see any event for this, and the control obviously knows when changes have been made... I currently have it hooked into a Dataset. Thanks! Moogy
  • 3. Limiting record numbers retrieved
    Scenario: 50000 Customers in table Customers, Each customer has 5 Contact records In related table Contacts, each contact has 5 Records In table ContactPhones related to table Contacts. The total number of records in this scenario is 50000 + 250000 + 1250000 = 1550000 records. We want to create a dataset with the objective of displaying 1 Customer record, and ONLY it's related Contacts, and ONLY the related ContactPhones of the currently selected Contact. That is a total of 11 records at any one time. The interface consists of textboxes for the fields bound to Customers, a Grid for the Contacts and a grid for the ContactPhones. When we change row in the Contacts Grid we want to retrieve the 5 ContactPhone records for that newly selected contact. We created a strongly typed dataset in which we place the correct relationships and tables but we realize that even though we filter the Customer for a given customer, all of the contacts and all of the contactphones get loaded in the dataset. This is ridiculously slow as it well should be. How do you limit the loaded records to what I described above, ie only those required for the current viewing and editing need? The number of customers is expected to increase dramatically over what we are currently testing and the default way is just plain unuseable. Any help appreciated. Bob

Maintaining relation between two tables when transferring records

Postby QmlsbA » Thu, 29 Jan 2004 08:21:04 GMT

Hi

I have two identical tables - same field names, identical datatypes(the tables are in different databases) and same
constraints

I need to transfer a record from one table to the other. While doing the transfer, the column names are to be
checked so that the right column data gets inserted into the other.
Though the column names are identical their order may be different in the tables

My thinking is having two data adapters and datasets and then do some sort of comparison of column names before I go ahead with the data insertion. Does that sound ok ?

Is there some other easy way ?

Thank
Bill

Re: Maintaining relation between two tables when transferring records

Postby Miha Markic [MVP C#] » Thu, 29 Jan 2004 21:54:00 GMT

Hi Bill,

Once the data is loaded you might consider using
DataTable.LoadDataRow, NewRow or ImportRow method to transfer a single row.
For merging entire DataTable you should see DataSet.Merge method.

-- 
Miha Markic [MVP C#] - RightHand .NET consulting & software development
miha at rthand com
www.rthand.com





tables are in different databases) and same
transfer, the column names are to be
tables.
of comparison of column names before I go ahead with the data insertion.
Does that sound ok ?



Similar Threads:

1.The same table cannot be the child table in two nested relations

2.same table cannot be the child table in two nested relations

i get the following error while reading an xml into a dataset
The same table cannot be the child table in two nested relation

is there a solution for it

3.maintaining relation ships of tables at run time

Hello Sir,

I have created database(ms access) and tables at runtime how to maintain
relation ships between the tables. by using vb.net.

Thanking u sir.


4.Datagrid and relation between two table.

Hi all,

I am having application where in i am having datagrid showing 2 tables
with relation between them.

When i click on relation which set i get records of second table in
same datagrid. And to go back i have to click on back buttoon. What i
want is to display both tables in same grid. Like when i click on
relation records should gets displayed in same grid. Means like tree
view structure.

How will i do this?

thanks in advance

5.datset with child table in two nested relations

i get the following error while reading an xml into a dataset
The same table cannot be the child table in two nested relation

is there a solution for it

XmlDataDocument datadoc = new XmlDataDocument()
datadoc.LoadXml(xmlstring)
ds = datadoc.DataSet;  

6. Error Message (Same table, cannot be the the child of two nested relations)

7. Transfer records from a table/DataGridView into text file

8. Adding Records to DataTable/Combining two tables/Take Data from DGrid to DTable



Return to dotnet framework

 

Who is online

Users browsing this forum: No registered users and 2 guest