|
-
I Love My Mommy
Connecting to SQL Server Express DB on PC
I've installed VS2005 and SQL Server Express w/Management Studio...
I've got all default SQL Server settings, I created my database, and I can connect to it via Management Studio.
Problem is I can't get Visual Studio 2005 to connect correctly.
Its set to use existing security (which is my local logon) and I checked permissions and only one (connect SQL) is granted to that username...
What do I need to do (I'm assuming its a fairly straight forward setup) to get visual studio to recognize and connect with my local SQL Express Server.
Main PC: MSI P965 Neo-F | nVidia geForce 7300GT | Intel C2D E6400 | 250GB SATA II WD Hard Drive | SB Audigy 2 Platinum | 8x DVD Burner| 2GB Corsair XMS DDR II 675 | Logitech z680's | Cordless MX Duo | Samsung 191T | (2) 19inch Rosewill 913E
HTPC: Abit IC7 | ATI Radeon 9800 Pro | Intel P4c 2.8Ghz | 120GB WD SE | Chaintech AV-710| 4x DVD+RW | 1GB RAM | Onkyo 7.1 Speakers | TV Tuner | Rosewill Cordless KB and Mouse | 15 Inch LCD | Panasonic PT-L500U Projector | USB 2.0 Card Reader
-
I had a similar problem just recently. Are you trying to get a website / web service hosted through IIS to connect to your database? If that's so, then you need to create an account named ASPNET in the sql server management studio. That's the account ASP.NET uses to connect to SQL server databases, but isn't set up by default in SQL Server.
Hope this helps.
-
I Love My Mommy
 Originally Posted by hu flung dung
I had a similar problem just recently. Are you trying to get a website / web service hosted through IIS to connect to your database? If that's so, then you need to create an account named ASPNET in the sql server management studio. That's the account ASP.NET uses to connect to SQL server databases, but isn't set up by default in SQL Server.
Hope this helps.
Yes, its a website hosted on IIS (well IIS isn't installed, so it's using the Casini web server installed with VS2005)...
I will give that a try, but quick question:
At work we don't use the ASPNet account (we have a seperate account) to connect.
Is there a way to do it setting up whatever account you want. This will be hosted on a GoDaddy windows hosting site - so I'd prefer to keep the account login information the same for consistency sake.
Basically, I'm curious what rights need to be in order to correctly connect.
Also, when I go to properties on the original database and then to permissions, no accounts are listed. When I go to add, the only ones it shows to add are "Public" and "Guest" where is my user logon?
Main PC: MSI P965 Neo-F | nVidia geForce 7300GT | Intel C2D E6400 | 250GB SATA II WD Hard Drive | SB Audigy 2 Platinum | 8x DVD Burner| 2GB Corsair XMS DDR II 675 | Logitech z680's | Cordless MX Duo | Samsung 191T | (2) 19inch Rosewill 913E
HTPC: Abit IC7 | ATI Radeon 9800 Pro | Intel P4c 2.8Ghz | 120GB WD SE | Chaintech AV-710| 4x DVD+RW | 1GB RAM | Onkyo 7.1 Speakers | TV Tuner | Rosewill Cordless KB and Mouse | 15 Inch LCD | Panasonic PT-L500U Projector | USB 2.0 Card Reader
-
Hmm... I don't have what I need on my home computer to check this, but if I remember correctly, you don't create accounts on individual databases. You create accounts in SQL Server, then for each database select which accounts can access it.
In your case, it might be a better idea not to do Windows authentication, but rather SQL Server authentication and pass the account's user id & password in the connection string. This will make it easier should you ever want to move the database to a different server than your website.
-
.
You need to create a login in SQL Server and then under User Mappings assign the user to the database you want to connect with. You will then have to assign a database role to that user besides public or give individual rights on the object in the database.
In your ASP.Net application, you need to setup your connection string to login using the SQL login:
Code:
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Last edited by ksuohio; 06-28-2007 at 09:41 AM.
---------------------------------------------------------------
- Asus M50 Laptop - C2D T9300 - 4 gig RAM - Radeon HD 3650 - Vista x64 Ultimate
- Intel i7-3770K - Asus P8Z77-V DELUXE - 32gig RAM - Radeon HD7970 Ghz - Plextor M3 256GB/120GB OCZ Vertex3
- LG BluRay - Razor Blackwidow Ultimate Keyboard - Logitech G9x
- HP ZR2740w/Asus LCD - W7 Ultimate
---------------------------------------------------------------
-
I Love My Mommy
 Originally Posted by ksuohio
You need to create a login in SQL Server and then under User Mappings assign the user to the database you want to connect with. You will then have to assign a database role to that user besides public or give individual rights on the object in the database.
In your ASP.Net application, you need to setup your connection string to login using the SQL login:
Code:
Driver={SQL Native Client};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;
Thanks guys - I'm connected and that aspect is working well...
But i've got another problem. When I set a breakpoint and debug the project, it just skips over the break point as if I weren't debugging at all.
All settings are default, only problem I could think that may be an issue is that I moved the project to a different folder than the default, and I did notice the MSBuild options show it as a different folder - but does that really matter?
Main PC: MSI P965 Neo-F | nVidia geForce 7300GT | Intel C2D E6400 | 250GB SATA II WD Hard Drive | SB Audigy 2 Platinum | 8x DVD Burner| 2GB Corsair XMS DDR II 675 | Logitech z680's | Cordless MX Duo | Samsung 191T | (2) 19inch Rosewill 913E
HTPC: Abit IC7 | ATI Radeon 9800 Pro | Intel P4c 2.8Ghz | 120GB WD SE | Chaintech AV-710| 4x DVD+RW | 1GB RAM | Onkyo 7.1 Speakers | TV Tuner | Rosewill Cordless KB and Mouse | 15 Inch LCD | Panasonic PT-L500U Projector | USB 2.0 Card Reader
-
.
You will need to make sure that the project is in debug mode. Look in the web.config file.
---------------------------------------------------------------
- Asus M50 Laptop - C2D T9300 - 4 gig RAM - Radeon HD 3650 - Vista x64 Ultimate
- Intel i7-3770K - Asus P8Z77-V DELUXE - 32gig RAM - Radeon HD7970 Ghz - Plextor M3 256GB/120GB OCZ Vertex3
- LG BluRay - Razor Blackwidow Ultimate Keyboard - Logitech G9x
- HP ZR2740w/Asus LCD - W7 Ultimate
---------------------------------------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|