views:

259

answers:

1

I have a ASP.Net web application with connection string for SQL Server 2005 in the web.config.

    Data Source=ABCSERVER;Network Library=DBMSSOCN;Initial Catalog=myDataBase;
User ID=myUsername;Password=myPassword;

I want to specify the collation property in the web.config for different languages like French like

    Data Source=ABCSERVER;Network Library=DBMSSOCN;Initial Catalog=myDataBase;
User ID=myUsername;Password=myPassword;Collation=French_CS_AS

But the Collation word is not valid in the connection string.

What is the correct keyword that we need to use to specify the collation in SQL Server 2005 connection string?

EDIT *I understand that collation can be set during the database installation and can also be changed. I do not want to change it permanently in the database. But I want the SQLClient to set the collation based on the application's settings. I only want use it when using SQL Query like "SELECT * FROM TESTTABLE ORDER BY TESTCOLUMN COLLATE French_CS_AS". I am trying to ensure that for a given connection, all the commands/queries for that connection would automatically use the "French_CS_AS" based on the property setting in the connection string, rather than changing the query definitions*

A: 

Collation is the type of encoding your database is setup to persist information as - i.e UTF8 or UFT16. This is something that is done when you install your server, and or when you create a new database, therefore as far as I know, not making it a setting you can change at runtime based on a specific connection to the database.

Enjoy!

Doug
Yes, it can be done during the installation and also when using SQL Query like "SELECT * FROM TESTTABLE ORDER BY TESTCOLUMN COLLATE French_CS_AS".I am trying to ensure that for a given connection, all the commands/queries for that connection would automatically use the "French_CS_AS" based on the property setting in the connection string.
techezine