Use the MSDE to access the database in .NET

xiaoxiao2021-03-06  15

First explain the MSDE, the full name is Microsoft Desktop Engine (Microsoft Desktop Engine)! Everyone knows that it is not able to install SQLServer servers in non-Server's systems. Is that we can't access the database in this operating system! It is definitely not! Otherwise, I am really nonsense in front! ^ _ ^

The development environment I here is 2000 Professinal VB.Net2003!

If you can't install the server, you cannot choose the login server's authentication mode, so if you try to use Server = localhost; uid = sa; pwd =; Database = XXX to connect to the connection database, this error is reported: system .DATA.SQLCLIENT.SQLEXCEPTION: User 'sa' failed. Cause: Not associated with trusted SQL Server connections.

Is not this nonsensical? SA users do not have databases?

Don't yell at me, I just want to give the most authentic error message!):

I encounter such an error that you might give up the moxi authentication mode to try Windows integration authentication. Web.config is set as follows:

You may have a well-designed data on the page is very grasped!

But what?

Very disappointed!

Error: system.data.sqlclient.sqlexception: The database requested in the login 'model' cannot be opened. Login failed. User 'zzq / aspnet' failed.

Shit!

But here I think if you are not very stupid, I have found the solution according to the error prompt! I am not very stupid like I, so I will try it as follows: 1. Open Enterprise Manager and find the local database. Note that local is not your newly built registration, otherwise the discussion here may be meaningless. 2. Find the database you want to use, the Sample Database of the System I used here, expand the database, click on the user entry right click, select New Database User. 4. The user (Windows User) of the system (Windows User) is displayed in the login name drop-down list in the pop-up dialog box, then select the computer name / aspnet, the username can not be changed. 5. Select the corresponding action in the check box allowed in the database role, if you want to attack the user's chance, choose DB_OWNER! ^ _ ^

Everything is OK! This will press F5 to see the effect! Is it a sense of accomplishment?

Later: The article itself has no technical content, but it is a little record in the actual operation! Write down these things hope to provide toner who will encounter this problem! That article is still a bit meaningful.

转载请注明原文地址:https://www.9cbs.com/read-46214.html

New Post(0)