VB.Net App Runs On Most Client Networks But Will Not Run On One Network

I have a very simple VB.Net app that does a query on a remote SQL Server 2005
database and displays query results in a grid and prints a Crystal report.  I
have installed it on several different clients on various networks, but it
wil not execute on one of my client's networks - the one where the SQL Server
and the subject database is located and which is running Windows 2003 Server.

In the failing app, I have a logon function that displays a login form,
accepts user ID and password, validates them against an SQL Server table,
displays login errors and then displays a menu form if the login is valid.  
The login form is displayed and accepted, the SQL Server lookup works
correctly, the error messages boxes display correctly, but the menu form
display code spawns a CLR "exception has occurred that cannot be handled"
dialog box.

I access the SQL Server database using a UDL file.

The same app installed on most networks/workstations works correctly.

However, it will not run on any workstation in the same domain as the SQL Server that manages the database (the one pointed to by the UDL) is located.  All of the failing workstations are running Windows XP Pro and VB.Net Framework 1.1 with
a service pack.

The setup/installation for this app was generated by Visual Studio .Net 2003.

Any clues?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Is it SQL 2000 instead of SQL 2005 running?  One issue that I've come across is the naming convention.  The database name for a SQL 2000 database needs to be all one word instead of being broken up.  For example "My Database" Wrong, "MyDatabase" Correct.

Another could be the security settings for the network.  I don't know how locked down they are, but I've seen issues with security before especially in a 2003 environment.

Try this, install the program locally on the server with the database and see the type of error messages you might get.  Are you placing Try statements in your code to catch messages?  Example:

'Your code here along with any SQL Scripts

        Catch Exp As SQLException
            MsgBox(Exp.Message, MsgBoxStyle.Critical, "SQL Error")

        Catch Exp As Exception
            MsgBox(Exp.Message, MsgBoxStyle.Critical, "General Error")
        End Try

I'm just spouting off some general ideas, hopefully they help.
portdataAuthor Commented:
No, it is SQL Server 2005.

They have other Visual Studio .Net apps running on their workstations accessing the same database.

Our program was written to supplement a system they already have which cannot do queries the way they want them to be run - by multiple selection criteria (like customer name, product ID and date received" in a single query.  So, we are trying to run our query ontheir existing workstations to give them the additional capability.

I am running that same query from my PC at my office (I am on my own SBS 2003 domain 60 miles away from them), connected to their SQL Server remotely using a UDL over a VPN link, and it works just fine.

I install the same app on one of their domain-connected PC's and it refuses to run.

SQL Server is not the problem.  The first thing my app does is give them a login screen to enter user ID and password (which are validated against the same SQL Server database and it works just fine.  If the user ID or password are invalid, I see the msg box that I am displaying to show them the error.  If they are valid, andI try to display the query menu, then I get a common language runtime dialog box with an error tellingme to use the JIT debugger (which is not installed on those PC's.)

We are attempting to run the compiled runtime code on the server with the database - that is the only place that the error occurs.  On any other network connected remotely to them, it works just fine.

They do not have VB.Net or Visual Studio.Net installed.  We are developing at our own offices.

Just FYI, I am a Microsoft Certified Partner and an MCP/Small Business Specialist.  I have been a software developer for 35 years and I write VB.Net code every day of the week.

This is just plain bizarre!

Cool.   I don't know what to tell you; you really do have a winner here for the record books.  Especially since you can run the login query with no problem, but the complex query comes back and sticks it's tongue at you.  My thinking is some wacky security settings or at least the environment is somehow affecting this.  I don't think this is a coding issue, but probably an environment issue.  As a certified Partner with Microsoft, try to use the Partner Source to contact someone from the "mother ship" and pose the question to them.   I'm sorry I couldn't be more help.
Introduction to Web Design

Develop a strong foundation and understanding of web design by learning HTML, CSS, and additional tools to help you develop your own website.

I don't know if this is something you want to do, but when I know there is a problem and I think it's an environment issue, I sometimes make a "test compiled program" and place messageboxes between steps of functions, so I can narrow it down where the problem is and what value is causing the issue.   It might help you in figuring out where and what part of the program is being effected by the domain.
portdataAuthor Commented:
I did that.

The error is being raised on a ShowDialog command - just trying to display a menu form.  Nothing unusual - just a bunch of labels.
Hmm.....you really really do have a winner here. I'm betting this is causing some hair being pulled out.  I know the felling.  ;) Another thought that might help narrow the issue; give any values that are being passed a default value.  For example if you are setting the label.text value to equal something, give it a "this is a default" string value first before passing the variable value, or setup an if then statement where if the object value is nothing or is Null, etc it will equal the default value instead.  There might be one rouge label out there that might be the wrench in the system; how I don't know.  
portdataAuthor Commented:
Keep one thing in mind.

This app works on lots of other computers - only fails on workstations attached to this server, in this domain.

I even tried stripping out individual labels on the menu and sending a much simpler menu form - still got the error.

I am now considering reinstalling .Net Framework on one of those PC's to se if that helps in any way.

All this work for three or four days of consulting billing.
"This app works on lots of other computers - only fails on workstations attached to this server, in this domain." - Yeah, that's the kicker isn't it?  No problems anywhere else but within the domian.  

Dude, bummer. Worse part is, it's their environment (domain) that's probably causing the issue.  Since it is SQL 2005 (being sort of new and all), and it fails only within the domain, but not outside, it may require a different type of connection string for inside the domain... but you did say the login query works, so that may not be it.  Just for laughs and giggles check out www.connectionstrings.com for maybe a different connection string to use.  Are the users logging in via Windows Authentication mode to the SQL server or are you using a Users table within the database to authenticate them to use the program? If you are using a Users table, then I'm back to scratching my head again.  
portdataAuthor Commented:
I am requesting that this question be closed.

I appreciate carmdoyk's efforts.

I recoded the app in VB 6 and it worked.

The original problem is still a mystery and is destined to remain so, at least for now.
portdataAuthor Commented:
carmodyk, FYI, the user security was set up properly and users log in with a userID and password, there was no explicit connection string because we use UDL's as the original question stated.  The user ID and password are supplied in the UDL.  The UDL connects to the database correctly- Test Connection works fine.  The app has no problem with the SQL database - it validates the user against the database properly.  The problem here is not likely to be SQL Server access, it is more likely a problem in the VB.Net app and the common language runtime.

GranMod, as for the points, I do not really care.  I have unlimited points.  I just do not believe that anyone earned them.
Sorry to hear the program was re-coded in 6.0.  You truly have an oddity on your hands, which is a shame with all that work having to be redone.  I feel your pain.  
Closed, 500 points refunded.
The Experts Exchange
Community Support Moderator of all Ages

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.