Click here to Skip to main content
15,886,963 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi everyone,
i try to connect my c# application to sql server 2012
my connection string is
connectionString="Server=.\MSSQLSERVER; Database=|AppData|\TechnicalOfficeManagerDB.mdf; Trusted_Connection=True;"

the application raise exception said
the value's length for key exceeds it's limit of '128' and don't connect to sql server

I don't understand what is the problem>
Posted
Updated 30-Aug-17 3:26am
Comments
ZurdoDev 12-Sep-13 7:34am    
connectionstrings.com
CHill60 12-Sep-13 7:41am    
What is |AppData| ... is this your substitution for a folder name?
tarekwarak0 12-Sep-13 7:57am    
yes, it is
CHill60 12-Sep-13 8:13am    
Then check that the length of |AppData|\TechnicalOfficeManagerDB.mdf is less than 128 characters and if not try moving the mdf to a shorter path name or even renaming the mdf itself to a shorter name.

 
Share this answer
 
Change the location of the database to a different folde, e.g. |ALLUSERSPROFILE|\YourCompany\DB.mdf
%ALLUSERSPROFILE% is typically C:\ProgramData, so a rather short path when compared to C:\Users\tarekwarak0460\AppData\Roaming - together with a shorter filename, that could help you getting below the 128 characters limit.
 
Share this answer
 
have a look here: msdn[^]
:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900