Questions tagged [datarelation]

60 questions
1
vote
1 answer

DataSet error calling GetChanges from an Expression Column 'cannot find primary relation'

Why is this code generating an error? Dim ds As New DataSet Dim tMaster As New DataTable(“TableMaster”) Dim idMPmaster As DataColumn = tMaster.Columns.Add(“IdMP”, GetType(String)) tMaster.Columns.Add(“Order”, GetType(Integer)) tMaster.PrimaryKey =…
1
vote
2 answers

Get Table in DataRelation at runtime

I try to explain with an example what i need I have a Patient and Order tables in db. Patient can have multiple orders through stored procedure i will get patient attributes and orders related to that patient and i will put it in dataset. But…
Abhijith Nayak
  • 448
  • 7
  • 21
1
vote
2 answers

WPF, EF4, and relations

Relations is probably the wrong word to use, but Data tables are what I have used before. I have EF4 pulling from a SQL database. Tables like Customer, Company, Department; things that usually go into Comboboxes for selection. I am holding them in…
Kyeotic
  • 19,697
  • 10
  • 71
  • 128
1
vote
0 answers

Why does neither a DataTable.Rows[i].Delete() nor a DataSet.AcceptChanges() seem to trigger the DataRelation?

I have created a relation between two tables, in order for one table's rows to be protected from deletion, but this seems not to work: My DB structure contains two tables, Areas and Locations. The Areas table has an Id column, while the Locations…
Dominique
  • 16,450
  • 15
  • 56
  • 112
1
vote
1 answer

Using DataRelations and DevExpress Grids - Hide expansion control

I have a bit of a weird issue. We use DevExpress controls to do all our Windows Form development. Anyway, I found a perfect use for the DataRow.SetParentRow/GetParentRow methods in my grid. So I created a DataRelation, added it to the DataSet and…
hsimah
  • 1,265
  • 2
  • 20
  • 37
1
vote
0 answers

How can I edit parent columns added via DataRelation in a DataGridView?

I have two tables within a DataSet that I relate as parent-child. I'd like to display and edit them within the same DataGridView. So I added the parent column of interest to the child table. Visualization is ok. In DataGridView I see all child rows,…
wizglins
  • 11
  • 3
1
vote
1 answer

Showing related Datatables via a Dataset in a Datagridview using collapsing/expanding rows .net

I have 2 datables being added to a dataset: a parenttable: Dim ctable As New DataTable("Category") ctable.Columns.Add("Category", GetType(String)) a childtable: Dim vtable As New DataTable("ValueTable") vtable.Columns.Add("Category",…
1
vote
1 answer

How to join datatables of a dataset?

I have a dataset which have four datatables. Table[0] contains columns such as: storedProcedure,DLLMethod,BLLMethod Table[1] contains columns such as: DLLMethod,BLLMethod Table[2] contains columns such as: UCName,BLLMethod Table[3] contains columns…
Prem
  • 5,685
  • 15
  • 52
  • 95
1
vote
1 answer

ADO.NET DataRelation

If I create a relation between 2 DataTable in my C# code and then update my DataAdapter + acceptChanged on my DataSet, will this Relation be repercuted on the server or is it only a client based relation which is effective only within the…
kite
  • 679
  • 2
  • 8
  • 19
1
vote
0 answers

Create One DataTable from Many within a DataSet (C# + XML)

I'm attempting to ingest multi-layered XML data from an API in order to insert it into a database. Firstly, once I've pulled the XML file from the API, I'm using DataSet's ReadXML method to create DataTables. There happens to be 19 in total within…
1
vote
1 answer

Master Detail Relation based on Information from 3rd Table

To start things off I'm trying to learn about DataGridView/BindingSource/DataRelation etc. I have allready read some tutorials and gathered information about the topic. So far I think I understood the basics and now I'm trying to experiment with the…
Urknecht
  • 415
  • 10
  • 16
1
vote
0 answers

DataGridViewRow save data when adding a new row C#

I have a DataGridView in Win Form with 2 ComboBoxColumns bound to each other. When a user chooses a category from first combobox column, values of the second one are filtered. When I add the first row the code works well, but when I add new row and…
Diana
  • 11
  • 2
1
vote
2 answers

ArgumentNullException when creating new datarelation

I have two unrelated tables in SQL Server. I want to form a relationship with them via C# so the database diagram in SQL Server has the relationship line etc (the code may have flaws apart from the lack of using statements etc, other than that let…
GurdeepS
  • 65,107
  • 109
  • 251
  • 387
1
vote
1 answer

F# Navigate object graph to return specific Nodes

I'm trying to build a list of DataTables based on DataRelations in a DataSet, where the tables returned are only included by their relationships with each other, knowing each end of the chain in advance. Such that my DataSet has 7 Tables. The…
Calvin
  • 423
  • 3
  • 12
1
vote
1 answer

LINQ - How can I use DataSet.DataRelation to join these tables and sum one field?

My LINQ query is not producing the expected output below. Basically, it's the sum of table3.cost corresponding to table2.code and table2.class categorized by table1.alias and ordered by table1.priority. I added two DataRelation's to the DataSet: …
David Fox
  • 10,603
  • 9
  • 50
  • 80