473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Child list exception

Hello:

I'm trying to connect "DataGridVi ew" to ".MDB" file
from the code:

string connectionStrin g =
"Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=C:\\file .MDB";

OleDbConnection connection = new OleDbConnection (connectionStri ng);
connection.Open ();

DataGridView1.D ataSource = connection.Data Source;
DataGridView1.D ataMember = "tblTime;

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

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 1633
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.co m

"dave" <da**@discussio ns.microsoft.co m> wrote in message
news:E5******** *************** ***********@mic rosoft.com...
Hello:

I'm trying to connect "DataGridVi ew" to ".MDB" file
from the code:

string connectionStrin g =
"Provider=Micro soft.Jet.OLEDB. 4.0; Data Source=C:\\file .MDB";

OleDbConnection connection = new OleDbConnection (connectionStri ng);
connection.Open ();

DataGridView1.D ataSource = connection.Data Source;
DataGridView1.D ataMember = "tblTime;

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

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
2659
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 option. Let's call the id of a class "cid" (for "class id"). The function signature should look like this:...
2
3797
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 AddItem2DropDown(item){ exists = false; for(d=0;d<drpDwn.length;d++){ if(drpDwn.options.value == item.value)
1
4217
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 put, there is an MDIForm and a child form. The MDIForm does the usual from within its constructor... this.IsMdiContainer = true; Form2 frm = new...
2
3409
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 get the parent form to read the child variable by using a Public Property in one of my child forms like such: Public ReadOnly Property ID() As...
10
3999
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 application. What should happen, is that the main MDI form should close, taking the child forms with it. There is code to loop through the child forms,...
5
4528
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 method using Application.Run(new MyMainParentForm) to place in the application's Sub Main to allow catching of unhandled exceptions in the application....
6
6070
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; protected $user; protected $output; public function __construct($database,$user,$output) { $this->database = $database;
0
3145
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 DebBacsfmDestAccs cannot be created' im at a loss as to how to resolve this .. i need help please code;
0
3288
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. Provide following view properties to listview, through View menu a. Tile b. Icon
0
7695
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5218
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.