views:

484

answers:

1

I know that we cannot set the Command Timeout in the Connection String. So I put it in the MyDataContext constructor. But there are many constructors, this file is usually overwritten by the visual designer and it doesn't seems the right way to do that. How would you do that?

A: 

I was putting the code in the constructor, but the right way to do that is to create a separate file and paste the code below:

partial class DataClassesDataContext
{
    partial void OnCreated()
    {
        this.CommandTimeout = Settings.Default.CommandTimeout;
    }
}
Jader Dias