?
Solved

removing datacontrol

Posted on 2001-08-02
8
Medium Priority
?
191 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 300 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

800 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