25 |
|
|
26 |
new public static string GetConnectionString() |
new public static string GetConnectionString() |
27 |
{ |
{ |
28 |
return string.Format(@"Data Source={0}\{1};;AttachDbFilename=|DataDirectory|\{2};Integrated Security=SSPI", DBServerAddress, DBServerInstance, DBDatabase); |
return string.Format(@"Data Source={0}\{1};AttachDbFilename=|DataDirectory|\{2};Integrated Security=SSPI", DBServerAddress, DBServerInstance, DBDatabase); |
29 |
|
} |
30 |
|
|
31 |
|
public override bool ClientRunScript(string[] strCommands, out Exception ErrorInfo) |
32 |
|
{ |
33 |
|
ErrorInfo = null; |
34 |
|
try |
35 |
|
{ |
36 |
|
foreach (string strCmd in strCommands) |
37 |
|
{ |
38 |
|
if (strCmd.Length > 0) |
39 |
|
{ |
40 |
|
Logging.DatabaseLog.DebugFormat("Current Command: {0}{1}", System.Environment.NewLine, strCmd); |
41 |
|
// Substitute database directory with the decided one. |
42 |
|
SqlCommand command = this.CreateCommandInstance(strCmd, new List<SqlParameter>(), out ErrorInfo); |
43 |
|
command.ExecuteNonQuery(); |
44 |
|
} |
45 |
|
} |
46 |
|
return true; |
47 |
|
} |
48 |
|
catch (Exception ex) |
49 |
|
{ |
50 |
|
ErrorInfo = ex; |
51 |
|
return false; |
52 |
|
} |
53 |
} |
} |
54 |
} |
} |
55 |
} |
} |