Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Object reference not set to an instance of an object...
ianr900
#1 Posted : Thursday, August 31, 2017 3:19:35 PM(UTC)
Groups: Member
Joined: 8/31/2017(UTC)
Posts: 2
Location: Leicester, UK

Hi All -
I am new to UltiDev and web servers in general, but I am trying to set up an ASP.NET web page created with MS VS. It uses a database and SQL express.

I built the site and tested it in VS by running it in the development server, and all seems well.
I installed UltiDev on my windows 7 machine, copied the web page directory structure, including the default.aspx, database file and web.config to a USB drive and registered it with UltiDev.

When click 'browse application' it pops up in chrome and everything works fine. However, when I try to do the same thing on my windows 10 laptop I get the 'Object reference not set to an instance of an object' on this line 'Line 87: If myDataReader.Read() Then'.

As it works fine under win 7, there can't be anything wrong with the code, and I am thinking it is something to do with the SQL Express on the Laptop.
So, my question is, how can I tell if SQL Express is working correctly?

And, is there any reason it wouldn't work under win 10?

Any help or suggestions would be much appreciated.

Thanks in advance

Ian
Ultidev Team
#2 Posted : Friday, September 1, 2017 7:59:18 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi,

The most likely culprit, if you access SQL Server using integrated authentication, is insufficient access rights. When running under UWS, your host process identity could be NETWORK SERVICE - limited account suitable for Internet-facing applications, LOCAL SYSTEM - almost administrator-like powerful account, not suitable for unsecured networks but easiest to work with, and for interactive/user hosts (those not hosted by service host processes) it is current logged-in user account. ASP.NET security is pretty convoluted, and we can't possibly explain it here, but recognizing it's one of the most common issues, we've put together a hub page pulling together lots of related information. On the system where UWS is installed simply go to http://localhost:7756/ to access it.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
ianr900
#3 Posted : Thursday, September 14, 2017 3:13:53 AM(UTC)
Groups: Member
Joined: 8/31/2017(UTC)
Posts: 2
Location: Leicester, UK

Hi -
Thanks for that information. I've read it, but I'm not sure I understand it!

You are correct that, if I set the host process in UltiDev Explorer to LOCAL SYSTEM, it works fine and I can browse my website. If I set the host process to NETWORK SERVICE, I get the error described in my first post (which I think means it cannot access the database).

If it is something to do with SQL access rights, how do I change that?

All the best

Ian
Ultidev Team
#4 Posted : Thursday, September 14, 2017 12:06:02 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Ian,

With SQL server you could use SQL authentication (SQL-specific username and password in your connection string) instead of integrated authentication, to solve this issue. Otherwise, with integrated authentication, you are accessing SQL server with the identity of the user running the program. NETWORK SERVICE is a restricted user, locked down for the purpose of running application facing lots of potential hacking threats, like internet-facing apps, or web apps facing corporate network where malicious actors are possible. Keeping NETWORK USER for your web application is a good idea to reduce chances of hacking. If your app runs under LOCAL SYSTEM and is successfully hacked, the attacker gets full control of your system and can access every file on the computer.

We recommend that you learn a little bit more about SQL access authorization. This issue is pretty general rather than UltiDev-specific, so your will get better support at StackOverflow.com.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Rss Feed  Atom Feed
Users browsing this topic
Guest (6)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.