Checking in latest SDALEO changes optimizing Advantage really only.

This commit is contained in:
2016-07-25 14:48:03 -04:00
parent 122796eaa3
commit 4a683f3443
114 changed files with 1173 additions and 372 deletions

View File

@@ -75,7 +75,7 @@ namespace Sdaleo
ServerAddress = values[0];
InstanceName = values[1];
}
else if (value.Length > 2)
else if (values.Length > 2)
{
int nIndx = value.LastIndexOf('\\');
ServerAddress = value.Substring(0, nIndx);
@@ -120,6 +120,11 @@ namespace Sdaleo
/// </summary>
internal string AttachDBFilename { get; private set; }
/// <summary>
///
/// </summary>
internal string ServerType { get; private set; }
#endregion
#region ReadOnly Bool Getters
@@ -180,6 +185,26 @@ namespace Sdaleo
#endregion
#region Advantage Constructors
/// <summary>
/// Construction Advantage (Set common UDL Settings for Advantage)
/// </summary>
/// <param name="path"></param>
/// <param name="filename"></param>
/// <param name="Password"></param>
/// <param name="ServerType"></param>
internal UDL(string FileNameNPath, string UserID, string Password, string ServerType)
{
UseConnectionTimeout = false;
this.DataSource = FileNameNPath;
this.Username = UserID;
this.Password = Password;
this.ServerType = ServerType;
}
#endregion
#region SQL Server Constructors
/// <summary>
@@ -330,6 +355,14 @@ namespace Sdaleo
strUDL += strAddMore;
}
// Advantage DB
if (!String.IsNullOrEmpty(ServerType))
{
string strAddMore = String.Format("ServerType={0};", ServerType);
strUDL += strAddMore;
strUDL += "TableType=ADT;";
}
// At the end, specifically add the connection timeout * If asked to *
if (UseConnectionTimeout)
{
@@ -367,41 +400,43 @@ namespace Sdaleo
String[] tokens = ConnectionString.Split(';');
foreach (string Pair in tokens)
{
string[] KeyValuePair = Pair.Split('=');
string[] KeyValuePair = Pair.Split('=');
try
{
string left = KeyValuePair[0];
string right = KeyValuePair[1];
switch (KeyValuePair[0].ToUpper().Trim())
{
case "INITIAL CATALOG":
DataBase = KeyValuePair[1].Trim();
DataBase = right.Trim();
break;
case "USER ID":
Username = KeyValuePair[1].Trim();
Username = right.Trim();
break;
case "PASSWORD":
Password = KeyValuePair[1];
Password = right;
break;
case "DATA SOURCE":
DataSource = KeyValuePair[1].Trim();
case "DATA SOURCE":
DataSource = right.Trim();
break;
case "ATTACHDBFILENAME":
AttachDBFilename = KeyValuePair[1].Trim();
AttachDBFilename = right.Trim();
break;
case "USER INSTANCE":
UserInstance = Boolean.Parse(KeyValuePair[1].Trim());
UserInstance = Boolean.Parse(right.Trim());
break;
case "CONNECTION TIMEOUT":
ConnectionTimeout = UInt32.Parse(KeyValuePair[1].Trim());
ConnectionTimeout = UInt32.Parse(right.Trim());
break;
case "TRUSTED_CONNECTION":
TrustedConnection = Boolean.Parse(KeyValuePair[1].Trim());
TrustedConnection = Boolean.Parse(right.Trim());
break;
case "INTEGRATED SECURITY":
@@ -420,9 +455,13 @@ namespace Sdaleo
Encrypt = true;
break;
case "SERVERTYPE":
ServerType = KeyValuePair[1].Trim();
break;
}
}
catch (Exception) { /* ignore and continue iteration */ }
catch (Exception e) { string m = e.Message; /* ignore and continue iteration */ }
}
}
}