473,396 Members | 1,917 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

ImportRow does not work w/ grand child relation

I have tried almost everything I know but still I can't find a way on
how to resolve this problem.

I'm using ImportRow to copy some record from 1 table to another table.
Here are my code that doesn't work:

Dim copyRows() As DataRow =
DsStudentCourse1.Tables("Course").Select("CourseCo de = 'AUTO 1'")

Dim custTable As DataTable =
DsStudentCourse1.Tables("SchYrSemCourseJoin")

Dim copyRow As DataRow

For Each copyRow In copyRows
custTable.ImportRow(copyRow)
Next

Me.DataGrid2.DataSource = DsStudentCourse1
Me.DataGrid2.DataMember =
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJ oin"

My problem here I think is in the DataGrid2.DataMember. Because if I
changed it w/ "SchYrSemCourseJoin" (which is the name of the
grandchild table) the code works fine. But of course I can't use it
since ""SchYrSemCourseJoin" is related from SchYrSem Table.

Here's the scenario.
I have three tables:
Students Table
SchYrSem Table
SchYrSemCourseJoin Table

SchYrSem is related from Students Table
SchYrSemCourseJoin is related from SchYrSem Table

The relation name of Students and SchYrSem is "StudentsSchYrSem"
The relation name of SchYrSem and SchYrSemCourseJoin is
"SchYrSemSchYrSemCourseJoin"

So therefore in order to view the related records of SchYrSem the
datamember of datagrid2 is
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJ oin"
Nov 21 '05 #1
2 1928
jaYPee,

To use importrow, you need to have a seperate identical table. (can be in
the same dataset).

That you get with
dim mytable as new datatable = myoldtable.clone

Did you do something like this, I do not see that in your code.

I hope this helps something?

Cor

"jaYPee" <hi******@yahoo.com>
I have tried almost everything I know but still I can't find a way on
how to resolve this problem.

I'm using ImportRow to copy some record from 1 table to another table.
Here are my code that doesn't work:

Dim copyRows() As DataRow =
DsStudentCourse1.Tables("Course").Select("CourseCo de = 'AUTO 1'")

Dim custTable As DataTable =
DsStudentCourse1.Tables("SchYrSemCourseJoin")

Dim copyRow As DataRow

For Each copyRow In copyRows
custTable.ImportRow(copyRow)
Next

Me.DataGrid2.DataSource = DsStudentCourse1
Me.DataGrid2.DataMember =
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJ oin"

My problem here I think is in the DataGrid2.DataMember. Because if I
changed it w/ "SchYrSemCourseJoin" (which is the name of the
grandchild table) the code works fine. But of course I can't use it
since ""SchYrSemCourseJoin" is related from SchYrSem Table.

Here's the scenario.
I have three tables:
Students Table
SchYrSem Table
SchYrSemCourseJoin Table

SchYrSem is related from Students Table
SchYrSemCourseJoin is related from SchYrSem Table

The relation name of Students and SchYrSem is "StudentsSchYrSem"
The relation name of SchYrSem and SchYrSemCourseJoin is
"SchYrSemSchYrSemCourseJoin"

So therefore in order to view the related records of SchYrSem the
datamember of datagrid2 is
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJ oin"

Nov 21 '05 #2
Not neccessarily I have to use the clone method since I'm using the
existing table.

Dim custTable As DataTable =
DsStudentCourse1.Tables("SchYrSemCourseJoin")
On Tue, 23 Nov 2004 08:52:51 +0100, "Cor Ligthert"
<no************@planet.nl> wrote:
jaYPee,

To use importrow, you need to have a seperate identical table. (can be in
the same dataset).

That you get with
dim mytable as new datatable = myoldtable.clone

Did you do something like this, I do not see that in your code.

I hope this helps something?

Cor

"jaYPee" <hi******@yahoo.com>
I have tried almost everything I know but still I can't find a way on
how to resolve this problem.

I'm using ImportRow to copy some record from 1 table to another table.
Here are my code that doesn't work:

Dim copyRows() As DataRow =
DsStudentCourse1.Tables("Course").Select("CourseCo de = 'AUTO 1'")

Dim custTable As DataTable =
DsStudentCourse1.Tables("SchYrSemCourseJoin")

Dim copyRow As DataRow

For Each copyRow In copyRows
custTable.ImportRow(copyRow)
Next

Me.DataGrid2.DataSource = DsStudentCourse1
Me.DataGrid2.DataMember =
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJ oin"

My problem here I think is in the DataGrid2.DataMember. Because if I
changed it w/ "SchYrSemCourseJoin" (which is the name of the
grandchild table) the code works fine. But of course I can't use it
since ""SchYrSemCourseJoin" is related from SchYrSem Table.

Here's the scenario.
I have three tables:
Students Table
SchYrSem Table
SchYrSemCourseJoin Table

SchYrSem is related from Students Table
SchYrSemCourseJoin is related from SchYrSem Table

The relation name of Students and SchYrSem is "StudentsSchYrSem"
The relation name of SchYrSem and SchYrSemCourseJoin is
"SchYrSemSchYrSemCourseJoin"

So therefore in order to view the related records of SchYrSem the
datamember of datagrid2 is
"Students.StudentsSchYrSem.SchYrSemSchYrSemCourseJ oin"


Nov 21 '05 #3

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

Similar topics

1
by: ahaideb | last post by:
I have a table (relation) in my database: --------------- | parent | child | --------------- | 1 | 2 | | 1 | 3 | | 2 | 4 | | 2 | 5 ...
1
by: Michael Van Altena via .NET 247 | last post by:
Why doesn't the following add a row to the table dtTemp1? System.Data.DataTable dtTemp1 = new System.Data.DataTable("Test1"); dtTemp1.Columns.Add("ColumnA",...
0
by: Uchiha Jax | last post by:
I have used this method many a time in previous applications without any hitches at all and i'm trying to use it in my current application and it isn't working. The only difference I can see is...
3
by: Gene Hubert | last post by:
I'm using DataTable.ImportRow to move data from one datatable to another... Dim dt, dtTarget As DataTable Dim dr As DataRow dt = DirectCast(Me.DataSource, DataTable) dtTarget = dt.Clone...
1
by: kempshall | last post by:
Hi, I have a question about the .NET DataTable.ImportRow method. If I import a DataRow into an empty DataTable, will the empty DataTable pick up the schema of the DataRow I'm trying to put into...
1
by: Hexman | last post by:
Hello All, What I'm trying to do is update a child record using a parent-child relation. I want to find out if it is faster than than doing multiple selects. Anyways, I've created a dataset...
1
by: jesper_lofgren | last post by:
Hello, i need to help here. I have a xmlnode as you can se below (full xml is in the bottom). I wonder how i can get the values inside the CSammanstallningLista . <CSammanstallning...
2
by: MarkS | last post by:
Hello Everyone tvServices.Nodes.Add("M1", "Parent") tvServices.Nodes("M1").Nodes.Add("S1", "Child") tvServices.Nodes("S1").Nodes.Add("x1", "Grand Child") The 1st 2 lines work fine but why...
2
by: ad08 | last post by:
Is this possible? I am trying to access function from grand parent window (the main window) in my child popup window but the parent window is closed in this case. a.jsp --> grand parent window...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...
0
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,...

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.