473,394 Members | 1,840 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,394 software developers and data experts.

ODBC Conection on a Winforms UserControl

I have an odbc connection on a Winforms UserControl when used within a
WinForms project it works fine but when I use it on an aspx page the object
doesn't show. The IIS log indicates code 200(successfully loaded). I am
suspecting this may be an issue with being fully trusted dll. I experimented
with the ODBC connection on a Webform control - it worked fine. I put the
ODBC connection on the aspx page - it worked fine. I put the connection on
my composite control (Winforms UserControl) and it doesn't load.

Any ideas?
Thanks,
Kurt Denhoff
Nov 17 '05 #1
2 2003
Hi,

Maybe your problem is that you're trying to use the OdbcConnection (which
you initialize on the page Load event) in the Load event of the control.
The Load event of the control executes BEFORE the Load event of the page, so
by that time is has not been initialized yet.
Move the code you have on the control Load event to the PreRender event
(which happens later) and everything should work.

Regards - Octavio

"Kurt Denhoff" <Kurt De*****@discussions.microsoft.com> escribió en el
mensaje news:2B**********************************@microsof t.com...
I have an odbc connection on a Winforms UserControl when used within a
WinForms project it works fine but when I use it on an aspx page the
object
doesn't show. The IIS log indicates code 200(successfully loaded). I am
suspecting this may be an issue with being fully trusted dll. I
experimented
with the ODBC connection on a Webform control - it worked fine. I put the
ODBC connection on the aspx page - it worked fine. I put the connection
on
my composite control (Winforms UserControl) and it doesn't load.

Any ideas?
Thanks,
Kurt Denhoff

Nov 17 '05 #2
I ended up making a control as much bear bones as possible. I placed the
control on the page with a connection string and it fails.

"Octavio Hernandez" wrote:
Hi,

Maybe your problem is that you're trying to use the OdbcConnection (which
you initialize on the page Load event) in the Load event of the control.
The Load event of the control executes BEFORE the Load event of the page, so
by that time is has not been initialized yet.
Move the code you have on the control Load event to the PreRender event
(which happens later) and everything should work.

Regards - Octavio

"Kurt Denhoff" <Kurt De*****@discussions.microsoft.com> escribió en el
mensaje news:2B**********************************@microsof t.com...
I have an odbc connection on a Winforms UserControl when used within a
WinForms project it works fine but when I use it on an aspx page the
object
doesn't show. The IIS log indicates code 200(successfully loaded). I am
suspecting this may be an issue with being fully trusted dll. I
experimented
with the ODBC connection on a Webform control - it worked fine. I put the
ODBC connection on the aspx page - it worked fine. I put the connection
on
my composite control (Winforms UserControl) and it doesn't load.

Any ideas?
Thanks,
Kurt Denhoff


Nov 17 '05 #3

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

Similar topics

2
by: David | last post by:
Hi, I created an MS Access 2000 front end a long time ago. We use it every day and everything works great. This MS Access DB is held in a folder on our Cobalt Qube server. On this server we also...
0
by: Greg Corradini | last post by:
Hello, Lately I've been using the mx.ODBC module to query Access (mdb) tables. For the life of me, I can't get the 'create table' sql command to work. I use this command in Oracle and I've seen...
0
by: Greg Corradini | last post by:
Hello all, I'm having trouble inserting an SQL selection into a new MS Access table. I get a parameter error on my insert statement when I try this (see below for code and error msg). I'm not sure...
1
by: S.Dickson | last post by:
I am very new to all this I have a access databse wich uses a ODBC conection to mysql server. I can open the and run the database find but if i leave the dadabase loaded but do not use it when i...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.