[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Reusing the datatable instance created by default on bound controls

Posted on 2009-05-14
6
Medium Priority
?
289 Views
Last Modified: 2012-05-07
This is more of a general question and am posting this after searching through the IDE generated code and not being able to find what I need!

I have a form with bound controls (combo boxes mostly). When I added them, the IDE automatically created the table adapters (whose creation instances I can see in the designer code) and on the form load event added code of the kind I've posted here.

My question is, while I can find the table adapter instances, I cannot locate the instances of the datatable themselves - I would prefer to reuse what's already been created for submitting my updates rather than create a new one.

Any help pls?

Thanks,
this.tblGroupsTableAdapter.Fill(this.dsSaphireOra.tblGroups);

Open in new window

0
Comment
Question by:Ignis2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24386493
You can see in the statement above that you have a Typed Dataset called dsSaphireOra and a Typed DataTable called tblGroups. Is that not what you are looking for?

http://thetonesofillusion.blogspot.com/2009/04/vb-net-typed-and-untyped-dataset.html
0
 

Author Comment

by:Ignis2
ID: 24393461
Umm, no. I do have the typed datasets - I'm not sure where the instance of these is being created and just how the plain thing works is a bit confusing!
Because, if I want to use it, I usually do something like

tblGroups tbl = new dsSaphireOra.tblGroups();

And I cannot find the instance being created anywhere - does the IDE create  a default instance on running which is what is accessible from the this pointer?
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 24393558
If the above line is automatically added to the code then it means that its an instance. I am not sure if default instance concept applies here.
0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 

Author Comment

by:Ignis2
ID: 24393799
Just to make things a little clearer, these are created when i bind the controls to the datatables. I can see instances of the table adapters being created :

tblGroupsTableAdapter = new dsSaphireOra.tblGroupsTableAdapter()

but can't find any reference to the datatables themselves. Any idea why? Am just trying to understand how this works, so I have better control over my code!
0
 

Author Comment

by:Ignis2
ID: 24393802
the lines of code I'm talking about are in the form.designer.cs - generated by the IDE!
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 600 total points
ID: 24393882
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question