specify language in localdb

1

I have a system to which I have created a demo, but I use the dates in the DMY format (Day / Month / Year) which is the default format in Spanish, but when I took the database to local db for the demo was put in English (apparently there is no way to put the database in another language) and the format in English is MDY (Month / Day / Year) and this generates exceptions.

Is there a way to specify in the connection string that you use the Spanish language, or to have the format for the dates be DMY?

    
asked by Bloodday 20.04.2016 в 19:14
source

1 answer

1

before each query you put SET DATEFORMAT DMY .

Example:

SET DATEFORMAT DMY
Select *from mi_tabla.

If you have a method that executes the queries, you can precede all those that arrive.

public void EjecutarSql(string sql){
sql="SET DATEFORMAT DMY " + sql;
.
.
.

}
    
answered by 20.04.2016 / 19:20
source