473,503 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Child list exception

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 connection = new OleDbConnection(connectionString);
connection.Open();

DataGridView1.DataSource = connection.DataSource;
DataGridView1.DataMember = "tblTime;

When execution get to the line:
"DataGridView1.DataMember = "tblTime".ToString(); "

There is exception:

"Child list for field tblTime cannot be created."
Does somebody know what i'm doing wrong ?

thank you,
dave

Jun 2 '06 #1
1 1630
dave,

The problem here is that you are trying to set the data source to the
connection. You can't do this. You have to assign a connection to a
dataadapter and then fill a dataset with that information. Then, you can
bind the data grid to the data set.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"dave" <da**@discussions.microsoft.com> wrote in message
news:E5**********************************@microsof t.com...
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 connection = new OleDbConnection(connectionString);
connection.Open();

DataGridView1.DataSource = connection.DataSource;
DataGridView1.DataMember = "tblTime;

When execution get to the line:
"DataGridView1.DataMember = "tblTime".ToString(); "

There is exception:

"Child list for field tblTime cannot be created."
Does somebody know what i'm doing wrong ?

thank you,
dave

Jun 4 '06 #2

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

Similar topics

16
2648
by: Suzanne Vogel | last post by:
Hi, I've been trying to write a function to test whether one class is derived from another class. I am given only id's of the two classes. Therefore, direct use of template methods is not an...
2
3786
by: Bostonasian | last post by:
I am trying to append options to dropdown in parent window from option items in child window. In parent window, I have following code: <script language="javascript"> function...
1
4213
by: Martin Douglas | last post by:
Hey guys, maybe someone can help me with some MDI issues I have. A co-worker asked me a very simple question, one that I blew off as trivial, and it has become a time-consuming issue. Simply...
2
3400
by: Jim Shank | last post by:
I am really trying to find the best OOP way of doing this. I have a parent MDI form with multiple children and I am trying to communicate variables between them. I have been able to successfully...
10
3983
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...
5
4522
by: Sam Loveridge | last post by:
Hi All. I'm hoping someone can point me in the direction of a solution to unhandled exceptions in MDI child forms causing the application to crash. I've found various articles describing a...
6
6065
by: reandeau | last post by:
I'm building out a OO based app in PHP 5 but I'm getting a little confused on children contructing parents. I have a parent that looks like this: abstract Class State { protected $database;...
0
3140
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...
0
3274
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
0
7199
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
7076
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
7274
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5576
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,...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
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 ...
1
732
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
377
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...

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.