Jump to content

Strange error working with sql

PerfectlyNutz

(Disclaimer - I do not know much about how to work with databases)

Okay so I got a project I'm working on. its A website in html, and I have A login page using aspx. on that page I have got a form asking for username and password.

To this point everything works fine. Now my problem only exists when I am working on the project from my PC at home. At school the problem does not occur. 

 

my problem is as follows: 

When I click on submit I start getting that little loading icon on my tab for a few second and right after I get this:

 

image.thumb.png.923abc48fc9d1ecc11bcaf66fadbe600.png

 

 

I have checked that all names are correct and there are no typos. 

Again this does work at my  school.

I've tried different vs version, didn't help.

 

What else could I try?

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, PerfectlyNutz said:

I have checked that all names are correct and there are no typos. 

Again this does work at my  school.

Where is the database running?

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, minibois said:

Where is the database running?

The database is running locally  

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, PerfectlyNutz said:

The database is running locally  

In that case the only issue could really be that your program doesn't have the right connection string (place a breakpoint on that line and see what the connection string is). Otherwise it could be an issue that sprung up recently with the code, so try going back to an older version of your code to see if it does the same thing.

 

Or maybe the right services are not running on your local machine.

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

35 minutes ago, minibois said:

In that case the only issue could really be that your program doesn't have the right connection string (place a breakpoint on that line and see what the connection string is). Otherwise it could be an issue that sprung up recently with the code, so try going back to an older version of your code to see if it does the same thing.

 

Or maybe the right services are not running on your local machine.

I did put a breakpoint and the string is ok. I also tried running prev versions of the code, error still occures. 

So it looks like it really has something to do with services. Do you have any ideas what services I should

Install / what I should do ? 

Link to comment
Share on other sites

Link to post
Share on other sites

Just now, elpiop said:

maybe some firewall rule at your school to not allow outside connections into the network?

I'm not trying to connect to my school network. The whole project is local. When I am at home all parts of the porject run locally on my computer.
Including the database which I am having the problem with. 

Link to comment
Share on other sites

Link to post
Share on other sites

What does your connection string look like?

 

Are you trying to connect using "(local)" or "localhost/127.0.0.1" or your IP address? If it is the later, I would assume the IP address you get at home isn't the same one you have at school.

 

In any case, since you're using SQL Server its service(s) needs to be running and listening on port 1433. Do you have the SQL Server Management Studio installed? Try to connect to your local SQL Server using that.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

1 hour ago, Eigenvektor said:

What does your connection string look like?

 

Are you trying to connect using "(local)" or "localhost/127.0.0.1" or your IP address? If it is the later, I would assume the IP address you get at home isn't the same one you have at school.

 

In any case, since you're using SQL Server its service(s) needs to be running and listening on port 1433. Do you have the SQL Server Management Studio installed? Try to connect to your local SQL Server using that.

I might have gotten a few thinks mixed here. I don't exactly know what to call it but I don't really have to start a seperate server.
my visual  studio did that automatically (I assume). 

 

This is the part where I connect to the database:

 

image.png.2a6a4c41f1a33e78f09fcb3cc2288929.png

 

this function works fine. But in the following function using the function above:

 

image.png.9654e34f57e226c2befdb917c9ed2e04.png

 

The error I was talking about (it crashes) at line 89 when trying to do conn.Open();

 

I do think the error comes from missing services or something because at my school everything was pre installed.

Also when I run my login page from visual studio It opens them in tabs using different port eachtime and not 1433 ( also at school):

 

image.png.dd81898f558c959483ffacc73477aed9.png

 

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

3 minutes ago, PerfectlyNutz said:

 

2 hours ago, PerfectlyNutz said:

Now my problem only exists when I am working on the project from my PC at home. At school the problem does not occur. 

When referring to your PC at home and 'at school', are you referring to the same computer (like a laptop you bring to school and back) or two physically different machines you're running the codebase on?

 

Is it possible you have just never installed the ASP.NET part of Visual Studio on your home computer?

"We're all in this together, might as well be friends" Tom, Toonami.

 

mini eLiXiVy: my open source 65% mechanical PCB, a build log, PCB anatomy and discussing open source licenses: https://linustechtips.com/topic/1366493-elixivy-a-65-mechanical-keyboard-build-log-pcb-anatomy-and-how-i-open-sourced-this-project/

 

mini_cardboard: a 4% keyboard build log and how keyboards workhttps://linustechtips.com/topic/1328547-mini_cardboard-a-4-keyboard-build-log-and-how-keyboards-work/

Link to comment
Share on other sites

Link to post
Share on other sites

2 hours ago, PerfectlyNutz said:

I do think the error comes from missing services or something because at my school everything was pre installed.

Also when I run my login page from visual studio It opens them in tabs using different port eachtime and not 1433 ( also at school):

 

image.png.dd81898f558c959483ffacc73477aed9.png

That's the port your web app is being served on. Port 1433 is the port SQL Server should be running on, which your web app then uses to talk to the database.

 

I agree with @minibois it sounds like you're using two different machines and one of them is missing some parts of Visual Studio that you need. Because right now it seems like there is no database running on your machine that web app can connect to, which is why it fails.

 

If possible, open the installer on the machine at school and see which components of VS are installed, then make sure to install the same components at home. At the very least I suspect you need to install some version of SQL Server Express.

Remember to either quote or @mention others, so they are notified of your reply

Link to comment
Share on other sites

Link to post
Share on other sites

Seems to me that your database is not hosted. You seem to have brought the database file home but you did not install SQL server express and ran the SQL Instance. Install Microsoft SQL Management Studio and see if you can connect from there. The installer for that software should also include and instance installer in the install menu if i recall correctly. Make sure to install it.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×