public static void SetClient(DataInfo dataInfo) { // Retro compatible #pragma warning disable CS0618 // Type or member is obsolete KCore.DB.Factory_v1.SetClient(dataInfo); #pragma warning restore CS0618 // Type or member is obsolete KCore.Base.IBaseClient client; switch (dataInfo.DBaseType) { case KCore.C.Database.DBaseType.Hana: client = new KCore.DB.Clients.HanaClient(); break; case KCore.C.Database.DBaseType.MSQL: client = new KCore.DB.Clients.MSQLClient(); break; default: throw new NotImplementedException(); } client.Connect(dataInfo); ClientType = client.ClientType; SetClient(client.GetType()); client.Dispose(); }
public static void SetClient(DataInfo dataInfo) { KCore.Base.IBaseClient client; switch (dataInfo.DBaseType) { case KCore.C.Database.DBaseType.Hana: client = new KCore.DB.Clients.HanaClient(); break; case KCore.C.Database.DBaseType.MSQL: client = new KCore.DB.Clients.MSQLClient(); break; default: throw new NotImplementedException(); } client.Connect(dataInfo); SetClient(client.GetType()); client.Dispose(); }
/// <summary> /// Set the connection default /// </summary> /// <param name="cred"></param> public static void SetClient(Credential_v2 cred) { var dbtype = (KCore.C.Database.DBaseType)cred.GetProperty("DBType").ToInt(); KCore.Base.IBaseClient client; switch (dbtype) { case KCore.C.Database.DBaseType.Hana: client = new KCore.DB.Clients.HanaClient(); break; case KCore.C.Database.DBaseType.MSQL: client = new KCore.DB.Clients.MSQLClient(); break; default: throw new NotImplementedException(); } client.Connect(cred); SetClient(client.GetType()); client.Dispose(); }