473,322 Members | 1,510 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,322 software developers and data experts.

Q: Child list for field x cannot be created.

Hi!

Have a little problem when i want to use the other dataset with the same
grid.

When i display the form i use the UniqueFolders. All works fine, then click
a button
and send InitializeGrid with FileDeletion as parameter and the exception is
raised. (See subject)

What to do? Do i have to clear the datagridview with some method or what?

This is my code:

void InitializeGrid(EGridInitialize gridInitialize)
{
switch (gridInitialize)
{
case EGridInitialize.UniqueFolders:
this.dataGridView1.DataMember =
DataSetUniqueFolders.Tables[0].TableName;
this.dataGridView1.DataSource = DataSetUniqueFolders;
this.dataGridView1.Columns[0].HeaderText = "Compare/Delete";
this.dataGridView1.Columns[1].HeaderText = "Project Path";
break;
case EGridInitialize.FileDeletion:
this.dataGridView1.DataMember =
DataSetUnusedFiles.Tables[0].TableName;
this.dataGridView1.DataSource = DataSetUnusedFiles; ;
this.dataGridView1.Columns[0].HeaderText = "/Delete";
this.dataGridView1.Columns[1].HeaderText = "File";
this.dataGridView1.Columns[2].HeaderText = "Complete path and file";
break;
default:
break;
}
}

/Martin
May 10 '07 #1
1 7655
Well, i found the solution, it was so easy :)

I set the DataMember and DataSource to null before i reinitialized again...

/Martin

"Martin Arvidsson, Visual Systems AB" <ma**************@vsab.netskrev i
meddelandet news:OL**************@TK2MSFTNGP05.phx.gbl...
Hi!

Have a little problem when i want to use the other dataset with the same
grid.

When i display the form i use the UniqueFolders. All works fine, then
click a button
and send InitializeGrid with FileDeletion as parameter and the exception
is raised. (See subject)

What to do? Do i have to clear the datagridview with some method or what?

This is my code:

void InitializeGrid(EGridInitialize gridInitialize)
{
switch (gridInitialize)
{
case EGridInitialize.UniqueFolders:
this.dataGridView1.DataMember =
DataSetUniqueFolders.Tables[0].TableName;
this.dataGridView1.DataSource = DataSetUniqueFolders;
this.dataGridView1.Columns[0].HeaderText = "Compare/Delete";
this.dataGridView1.Columns[1].HeaderText = "Project Path";
break;
case EGridInitialize.FileDeletion:
this.dataGridView1.DataMember =
DataSetUnusedFiles.Tables[0].TableName;
this.dataGridView1.DataSource = DataSetUnusedFiles; ;
this.dataGridView1.Columns[0].HeaderText = "/Delete";
this.dataGridView1.Columns[1].HeaderText = "File";
this.dataGridView1.Columns[2].HeaderText = "Complete path and
file";
break;
default:
break;
}
}

/Martin

May 10 '07 #2

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

Similar topics

6
by: Bob Swerdlow | last post by:
My application starts up a number of processes for various purposes using: self.popen = popen2.Popen3("/usr/local/bin/python -O "myscript.py") and then shuts them down when appropriate with...
7
by: Neo Geshel | last post by:
Greetings. I have a serious problem. I have multiple sets of tables, several of which are chained more than two tables deep. That is, I have a parent, a child, and a great-grandchild table. ...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
by: Darin | last post by:
This is something that on the surface seems like it should be simple, but I can't think of a way to do this. I have a table that is a list of "jobs", which users create and use. It has a single...
1
by: dave | last post by:
Hello: I'm trying to connect "DataGridView" to ".MDB" file from the code: string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\\file.MDB"; OleDbConnection...
7
by: S. Lorétan | last post by:
Hi guys, Sorry for this stupid question, but I don't know why it isn't working. Here is my (example) code: namespace Test { class A { public string Label1; }
4
by: normb | last post by:
My name is Norm, I changed something that caused this problem, and I do not what it was. I also do not know how to debug this problem! The line where the crash occures is marked by an *. The...
0
by: Pete Newman | last post by:
In running vs (vb ) .net 2005 and Sql 2005 On my form i have an oledbconnection, an oledbdataadapter and a dataset. when i try and do an update i get an error; 'Child list for field...
3
by: janero | last post by:
Where do i go wrong here? i have an access database, and i need to access each table more then once. I created a test i a new project: one class ...
0
by: =?Utf-8?B?QXR1bCBSYW5l?= | last post by:
Hi, I am using datagridview when, I am assigning datasource to Datagridview i am gettin exception "Child list for field Region cannot be created." I am Assigning Collection as a datasource to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.