Solved

removing datacontrol

Posted on 2001-08-02
8
189 Views
Last Modified: 2010-05-02
I have a usercontrol (2 text boxes + 3 option buttons) that is used in a datarepeater. The fields in the usercontrol are bound to the ADO data control.

My question is - can i bind these fields to a data source class, instead?

Would getting rid of the datacontrol help speed up my app.?

thanks

0
Comment
Question by:jlymn
[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
  • 2
8 Comments
 
LVL 3

Accepted Solution

by:
daffyduck14mil earned 75 total points
ID: 6343938
Hi,

Yes, you can bind the textboxes and option buttons to a Data source class. You will loose the ADO Datacontrol, but get a reference to the DataBindings object.

There is a good "how to create your own data source class" in the MSDN library at the location: Visual Studio Documentation, Visual Basic Documentation, Using Visual basic, Programmers Guide, Programming with Objects, creating Data-aware classes.

If it will speed up the execution of your program, I haven't noticed it. What I did notice is a great increase in maintainability, and if you ever want to scale the app to a n-tier sollution, it's a bit easier.

Grtz.©

D.
0
 

Author Comment

by:jlymn
ID: 6344343
i tried the example from msdn, that helped a lot.

Now i can bind the properties to the database fields. The problem is that my new data class isn't visible on the datarepeater's datasource combo list.

This means that i can't get a list of the propertynames and datafields in the repeaterbindings tab (in the property pages of datarepeater)

I assume i need to do this programmatically instead & I see how toi create the object and set datarepeater's datasource to my class, but how do i match each propertyName to a DataField..?







0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6344430
DataControl adds a little overhead. If you replace the datacontrol with a data source class, if strongly beleive that you will loose speed.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:jlymn
ID: 6345131
emoreau - thanks - maybe i should stick with what i've got..? It seems to work ok.

daffy - how will it help with maintainability, to use the dataclass? Is it worth the extra effort do you think?

0
 
LVL 3

Expert Comment

by:daffyduck14mil
ID: 6345187
Hi,

It depends on how large your project is. I can not even begin to imagine the work it will take if you have a 500+ table database (typical goverment database), and didn't do (most) things in a class or something and find out you missed one field name or need to add one later. Ack.. %)

Anyway, if it's small, stick with the ADO control, the class is just one layer less (no graphical control). Imho, it's most of the time not worth the extra effort, but it can come in handy if someone ever needs to work on your program. It's a tradeoff, like most things. Hmm, time to go home, I just started rambling....

Grtz.©

D.
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6345310
Are you aware that you can directly bind controls to a recordset using ADO?

Set text1.datasource = rstSomething
text1.datafield = "OneField"
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 6357976
Any decisions yet?
0
 

Author Comment

by:jlymn
ID: 6358638
emoreau - I didnt realise you could bind directly without the datacontrol. I'll stick with it this time anyway. It seems easier to use with the datarepeater.

Daffy - Its a small project so i'm going to be lazy and stick with what i've got. Thanks for the input..

Points to daffy and 50 in dummy question for emoreau

0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

734 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