Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / September 2005

Tip: Looking for answers? Try searching our database.

Form2 DataAdapter/DataSet

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rich - 30 Sep 2005 22:13 GMT
Hi,

I've done a drag and drop of a sqlDataAdapter and generated a dataset on a
second WinForm (Form2) I'm opening as a dialog box. I can bind to it and
retrieve results but I get an error when I try to use any
BindingContext.Count/Position methods on the dataset. Any help greatly
appreciated.

Error: 'Cannot create a child list for field myTable.'

Code Snippet Follows:=======================================
try
{
int iCnt;
iCnt = this.BindingContext[this.dsDataSet1, "myTable"].Count;
}
catch(Exception exp)
{
MessageBox.Show(exp.Message.ToString());
}
Pete Davis - 30 Sep 2005 23:13 GMT
What is the content of your DataSet? Is "myTable" the name of a table in the
DataSet?

Are you sure that's the table name and not the name of the DataTable
variable? In other words, is dsDataSet1.Tables[0].TableName = "myTable"?

Assuming of course that your dataset only has one table.

Pete

> Hi,
>
[quoted text clipped - 16 lines]
> MessageBox.Show(exp.Message.ToString());
> }
Rich - 01 Oct 2005 00:39 GMT
Hi, and thanks for responding.  There is only one table in the dsDataSet1
DataSet and that table is 'myTable'.  

> What is the content of your DataSet? Is "myTable" the name of a table in the
> DataSet?
[quoted text clipped - 26 lines]
> > MessageBox.Show(exp.Message.ToString());
> > }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.