it is possible in the code
https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.commandtimeout(v=vs.110).aspx
using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnStringName"].ToString()))
using (SqlCommand mySqlCommand = new SqlCommand())
{
try
{
conn.Open();
mySqlCommand.Connection = conn;
mySqlCommand.CommandType = CommandType.StoredProcedure;
mySqlCommand.CommandText = "getCities";
mySqlCommand.CommandTimeout = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["ConnectionTimeout"].ToString());
mySqlCommand.Parameters.Add("@param", SqlDbType.VarChar).Value = param;
da.SelectCommand = mySqlCommand;
da.Fill(ds, "cities");
}
catch (Exception ex)
{
}
} // end using
------------ you can try
OPENQUERY (Transact-SQL)
http://technet.microsoft.com/en-us/library/ms188427.aspx
check this:
connections OPENDATASOURCE
http://technet.microsoft.com/en-us/library/ms179856.aspx
Connect timeout DBPROP_INIT_TIMEOUT Time-out value after which the connection try fails.