Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Database Loading Question (Read 2300 times)
brnixon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: May 16th, 2009
Database Loading Question
May 16th, 2009 at 3:40am
Print Post  
Searched the forum and couldn't find if this has been asked.  I downloaded the trial version of this software about 2 weeks ago to see if it would work on a project I'm working on.  I am using the Access database provided with the software for now but will probably move to something else eventually.  My question is this, I have set up the databinding as Tutuorial 9 has showed, however, would this not cause the problem of continuing to use up resources indefinately with the LoadfromDataSource()?  I'm confused on how to only query and return the specific data that I would need when setup through the tool.  It pulls ALL data and this would be an issue as more and more appointments are added over time.  How do I change the query to only load for a specific time frame without setting up the databinding manually?

-Brandon
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Database Loading Question
Reply #1 - May 16th, 2009 at 6:01am
Print Post  
Unfortunately, currently there is no way to do this. If you want partial loads you have to query the database manually.

Meppy
  
Back to top
 
IP Logged
 
brnixon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: May 16th, 2009
Re: Database Loading Question
Reply #2 - May 16th, 2009 at 4:13pm
Print Post  
Well, is there a way to take advantage of some of the built in data features while choosing custom database queries.  I'm not too familiar with how database bindings work and am wondering if I am going to start from scratch or be able to take some shortcuts.

-Brandon
  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: Database Loading Question
Reply #3 - May 18th, 2009 at 7:54am
Print Post  
I will use Tutorial 9 as a base of the following solution.

1. Open the Tutorial 9 project and open the designer of Form1.

2. Right-click on 'itemTableAdapter1' and select 'Add Query...' from the context menu.

3. In the dialog that appears add the following parametrized query in the 'Query Text' text box:

Code
Select All
SELECT Item.*
FROM Item
WHERE Item.StartTime>=? AND Item.EndTime<=? 


Make sure that 'New query name' is selected and use the default name for the new query - FillBy. Click 'OK'.

4. Navigate to the event handler of the 'Load' button and make the following modification of the event handler's code:

Code
Select All
// itemTableAdapter1.Fill(plannerDataSet.Item);
itemTableAdapter1.FillBy(plannerDataSet.Item,
      new DateTime(2000, 1, 1), new DateTime(2001, 1, 1)); 


What we are doing above is that we comment the code that loads all items using the default select query of the Item table adapter and instead use the newly created parametrized query. The specified start and end time are completely exemplary. You should use start and end time that meets your criteria.

5. Run the application and try loading the items using the new method.

Regards,
Meppy
  
Back to top
 
IP Logged
 
brnixon
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 3
Joined: May 16th, 2009
Re: Database Loading Question
Reply #4 - May 18th, 2009 at 7:05pm
Print Post  
Fantastic!  Thanks so much for the info.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint