Friday, February 24, 2012

Connecting problems

Hey all, i'm a student who didn't pass his asp.net exame, now i have to redo it next Friday, so i'm repeating my all my exercises. Now i have to make a webservice and then connect/use to this webservice from a normal WinGUI form. The webservice gets its data from a ms sql database. Now when i test the webservice and i debug, i see that my application stops when trying to open the connection. When i run the wingui form it says "server does not exist access is denied".
This is my connection string

<addkey="ConnectionString"value="Data Source=localhost; Initial Catalog =MCT_WEB3_AIRLINES; User Id=Jay "/>
I'm sure this should work, because i copied it from a friend of mine who's application does work(changed user offcourse). So i assume that there is nothing wrong with my asp.net project.
There has got to be a problem with my database permissions or something. The weird thing is, we've got a example from school wich uses the standard northwind database, user sa, and that doesn't work either...i assume there i something wrong with my general ms sql server settings (not so much my users permissions).
Can anybody tell how i can solve this? wich things i have to check? is there a tool just to test your database connection with a certain user?
Really hope somebody can help me out.
Thx in advance

each machine will have different values to log in so the connectionString will be different for each person machine !!|||

I did change the user in the connection string, but the database and everything is the same ...it was the same exercise...
I think i just forgot to do something with my ms sql server...i just installed it, added a database with the same name as the backup file/database we got from school, restored the database, and then added a user Jay...

|||what was the setting of the Sql server ? windows authentication... trusted connection or standard ? ...let me start with you ... one of my interest is to help in connection to the DB ....let us solve it ... reply to me and i will see what to do?|||

The Authentication mode is Windows only, as it was suggested by thewalktrough PowerPoint(for installing ms sql server in general, not forasp.net in particular) we received from school. Thanks for trying tohelp me out! really appreciate it.

|||ok!!!
what suggest is to to the testing on the one of the built in databases like Northwind so we ensure that if the connection is working or not as you know sometimes you need to add users and set permession... so to start and test propoerly leave your DB and all the testing will be on the northwind or ( whetever built in DB)

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;"
- or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;"
(both connection strings produces the same result)

(use serverName\instanceName as Data Source to use an specifik SQLServer instance, only SQLServer2000)
use one of these format and make sure you test both of them...... when you get error let me know what is the error message you got !!! and do not forget to test the built in DB not yours !!!
i will wait for your result!!

|||For the northwind database it just worked actually there were no errors.
So i tried it with my database/program wich i need it in, and there i got...
I got this message Cannot open database requested in login 'MCT_WEB3_AIRLINES'. Login fails.
Login failed for user 'TOS832360\ASPNET'.
So i added the aspnet account to the users of my database...and it seems to work perfectly.
This perhaps is not the most perfect way, but it works for me!
Thanks a million times for your help! I really didn't feel good about the examen until now!

|||great to know it is sorted ..... what you did is ok and there is nothing wring .... you need to add user to the DB to gain permission and this is what you did .......you are on the right track now ....i am glad that you solved your problem so i add that to me record as i like sove these problems...any thing you need later get back to me !!! Good luck!|||i'm in the same school you are, doing the same exam tomorrow :) istumbled upon this post when i entered "MCT_WEB3_AIRLINES" in googlebecause i'm searching for the database that particular excerciseconnects to. any chance you can share it with me (don't think it'ssubdata from the northwind database right?)
if you'd have the chance to read this message before tomorrowafternoon, then pls send me the correct airlines mssql database atlunchbox@.telenet.be
thanks in advance, and good luck on yr exam tomorrow and the daysfollowing. (if you're as unlucky as me having multiple to attend again)

No comments:

Post a Comment