Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Connecting string to SQL Server
Message
 
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01532080
Message ID:
01532094
Vues:
23
>No, that is not the problem. In C# you have to have the second \, I forgot the term used for it though.
>
May be to escape the \
You can always use @ in front of the string so you don't need to escape special characters.

>>I think there is one too many \
>>
>>Try
>>
>>MyComputer\SQLExpress;database=MyDatabaseName;Trusted_Connection=Yes"
>>
>>>Hi,
>>>
>>>When I am testing my ASP.NET to connect to SQL Server I use the following connecting string:
>>>
>>><pre>
>>>connString = "server=MYCOMPUTER\\SQLEXPRESS; database=MyDatabaseName; Trusted_Connection=Yes"
>>>
>>>
>>>But I get an error:
>>>
>>>
>>>Cannot open database "MyDatabaseName" requested by login. The login failed. 
>>>Login failed for user 'MYCOMPUTER\Dmitry' 
>>>
>>>
>>>I suppose the "Trusted_Connection" syntax is not recognized, right? What should I change in my connString?
>>>
>>>TIA
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform