Solved

removing datacontrol

Posted on 2001-08-02
8
187 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
  • 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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

ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

803 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