473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Dirty User Control in Toolbox causes ConnectionString Failure?

Hello Everyone:

I used VB.NET 2003 Standard to create a User Control which I named
PersonControl and then overrode its OnLoad routine to use SQL commands to
populate its sub-controls.

When I tried to use the Form Designer to add my PersonControl to a form in
my application, I got the following error dialog box:
Title: Microsoft Development Environment
Text: The ConnectionString property has not been initialized.
Buttons: OK

After viewing the error dialog, I made two assumptions:
1) My DB connection didn’t go active until my application was running
2) The forms designer was, for some odd reason, invoking the OnLoad override
of my PersonControl which was doomed to fail since my DB connection was in
fact not initialized.

After making the two assumptions, I commented out the OnLoad override of my
PersonControl and tried adding it to my form via the toolbox once again as a
test, but I still got the error. With the OnLoad override commented out for
the PersonControl, I could not see any reason why adding it to a form would
cause the above mentioned dialog error.

It appears that a dirty/old copy of the PersonControl is presently lurking
around in my Toolbox and that I can’t replace it with a new one.

Can someone help answer the following questions for me?
1) Does the VB.NET forms designer automatically call the OnLoad function for
all controls when they are placed in a form being designed even though the
application is not yet running?
2) After you manage to populate your toolbox with a custom User Control, how
do you ensure that the control instance residing in your toolbox updates its
behavior whenever you change the source code used to generate that control?

Respectfully,

Shawn Eary
--
“And whatever you do, whether in word or deed, do it all in the name of the
Lord Jesus, giving thanks to God the Father through him.”
Colossians 3:17 (NIV)
Nov 21 '05 #1
1 1621
Shawn,

In a good design there is in the UI no database "system.data" action.

You create it even in a user control.
Do you think that you are on the right track?

Why I tell this.
It is never interresting to spend time to help for a bad designs.

Cor
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Henke | last post by:
I added a project to my solution that contains a user control. Now I 'd like to add the user control from that project to a form in my solution. The problem is that the control doesn't gets added...
6
by: Sean C. | last post by:
Helpful folks, I am having a hard time figuring out how to reduce my percentage of dirty page steal activity. Below are statistics for three fairly normal days, with the bufferpool hit ratios...
15
by: Rey | last post by:
Howdy all. Appreciate your help with several problems I'm having: I'm trying to determine if the Visit subform (subformVisits) has a new record or been changed, i.e. dirty. The form that...
4
by: Paradox | last post by:
Hey, I'm trying to figure out what situations call for the use of a derived form control such as: public class myListBox : System.Windows.Forms.ListBox and what situations call for the use...
1
by: steve bull | last post by:
I created a control and added to my toolbox and it worked fine including the controls icon until I decided to merge the project that contains the control into an existing project. I have included...
0
by: Philippe Meunier | last post by:
Hi, I am building a solution in VB.NET, and one of the project in the solution contains my user controls (and inherited controls), Everything is ok when I just came to add the user control and...
1
by: Philippe Meunier | last post by:
Ok, I already asked a question similar to this one but didn't found any answer ! I've a solution with 2 projects in it. One of the project contains Usercontrols and Inherited Controls. I work...
4
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
5
by: Tony Johansson | last post by:
Hello! I have one solution file that consist of three project. One project that build the exe file called A One project that build a user control dll. Here we have a class called B One project...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.