Problem connecting to the database after upgrading from .Net 1.1to .Net 3.0??

  • Thread starter Thread starter Michael Howes
  • Start date Start date
M

Michael Howes

I am trying to upgrade a large asp.net application from .Net 1.1 to
..Net 3.0

I'm getting an error when connecting to the database now that the app
runs as a .Net 3.0 application.

the database connection code is part of Microsoft's ApplicationBlocks,
the Data Access Block. The project is using the SQLHelper class from MS.

The connection fails the SqlConnection call to Open()
Looking at the SQL Server 2005 logs it thinks the "Login failed" with
an Error 18456, Severity 14, State 5 which I think means some sort of
wrong password.

The exact code works in .Net 1.1
The error happens after upgrading .Net 3.0
If I change the <trust level= in the web.config from Medium to Full
the .Net 3.0 call to SqlConnection.Open() works just fine.

This application needs to run under Medium trust.

anyone have any ideas what I need to change to get this to work under
Medium trust? Other settings I need to make in the web.config maybe?
Do I need to upgrade to a newer version of Microsoft's Enterprise
Library?

thanks
mike
 
Ther simple answer is aim for the newer Enterprise library. This means
changing code, as it is completely different from the Application block you
are using.

Another option is to run in debug and find out where it is blowing up and
correcting that code. Maybe not the best long term strategy, but it works.
You will need to run against the block's source code to do this, not the
compiled block.

--
Gregory A. Beamer
MVP, MCP: +I, SE, SD, DBA

Subscribe to my blog
http://feeds.feedburner.com/GregoryBeamer#

or just read it:
http://feeds.feedburner.com/GregoryBeamer

********************************************
| Think outside the box! |
********************************************
 
Another option is to run in debug and find out where it is blowing up
and correcting that code. Maybe not the best long term strategy, but it
works. You will need to run against the block's source code to do this,
not the compiled block.

the reason I think it's a trust issue is because I did trace and it
gets to the SqlConnect call to .Open() and fails. But this fails only
under Medium trust and not Full trust. In other words I already know
where it's failing, just don't have a guess as to why.

mike
 
Back
Top