Show / Hide Table of Contents

Class WMSQLServerDataSource

Data Source Element implementation for SQL Server.

Inheritance
object
WMAssetBase
WMDataSourceBase
WMSQLServerDataSource
Implements
IHasEncryptedValues
IWMDataSource
IWMAsset
IDbEntity
IWMEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
IDisposable
IDocumentedEntity
INamedEntity
Inherited Members
WMDataSourceBase.EncryptionPlaceholder
WMDataSourceBase.RegisteredType
WMDataSourceBase.InnerDataSource
WMDataSourceBase.AccessorString
WMDataSourceBase.Get(WMPrincipal, string, WMAppDbContext)
WMDataSourceBase.CacheDataSource(string, WMDataSourceBase)
WMDataSourceBase.DeleteCacheDataSource(string)
WMDataSourceBase.TryGetCachedDataSource(string, out WMDataSourceBase)
WMAssetBase.ID
WMAssetBase.CreatedBy
WMAssetBase.CreatedDate
WMAssetBase.LastUpdatedBy
WMAssetBase.LastUpdatedDate
WMAssetBase.Name
WMAssetBase.Documentation
WMAssetBase.DocumentationMIMEType
WMAssetBase.Summary
WMAssetBase.ParentDirectory
WMAssetBase.FullPathName
WMAssetBase.Properties
WMAssetBase.Owner
WMAssetBase.OwnerID
WMAssetBase.OwnerType
WMAssetBase.Get<T>(WMPrincipal, string, WMAppDbContext)
WMAssetBase.GetSync<T>(string, string)
WMAssetBase.CreateFullPathName(WMAssetDirectory, string)
WMAssetBase.GetFullPath(WMPrincipal, string, string, WMAppDbContext)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Quantellia.WMServer.Asset.DataSource
Assembly: WMServer.dll
Syntax
public class WMSQLServerDataSource : WMDataSourceBase, IHasEncryptedValues, IWMDataSource, IWMAsset, IDbEntity, IWMEntity, IWMAssetDirectoryMember, IWMPrincipalOwned, IDisposable, IDocumentedEntity, INamedEntity

Constructors

WMSQLServerDataSource()

Constructor for WMSQLServerDataSource

Declaration
public WMSQLServerDataSource()

WMSQLServerDataSource(string)

Constructor for WMSQLServerDataSource, with specified ID

Declaration
public WMSQLServerDataSource(string ID)
Parameters
Type Name Description
string ID

WMSQLServerDataSource(string, string)

Constructor for a new WMSQLServerDataSource that optionally initializes the connection string.

Declaration
public WMSQLServerDataSource(string id = null, string connectionString = null)
Parameters
Type Name Description
string id
string connectionString

Methods

Close()

Close the connection and dispose of its internal resources.

Declaration
public void Close()

CommitTransaction(string)

Commit the transaction, if one is active.

Declaration
public override void CommitTransaction(string id)
Parameters
Type Name Description
string id
Overrides
WMDataSourceBase.CommitTransaction(string)

Connect()

Declaration
public override void Connect()
Overrides
WMDataSourceBase.Connect()
Exceptions
Type Condition
NotImplementedException

Create(WMDataWriter, bool)

Create a new writer record as specified in the WMDataWriter

Declaration
public DataTable Create(WMDataWriter writer, bool closeOnExit = true)
Parameters
Type Name Description
WMDataWriter writer
bool closeOnExit
Returns
Type Description
DataTable

Delete(WMDataWriter)

Declaration
public void Delete(WMDataWriter writer)
Parameters
Type Name Description
WMDataWriter writer

DeleteData(WMPrincipal, string, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Updates data in the data source. This method currently makes use of existing Evaluation infrastructure, but should be moved to a less cumbersome method whenever possible. It is assumed that args has been confirmed to both contain elements, and that each transactionID is the same, if any.

Declaration
public override Task<ElementValue> DeleteData(WMPrincipal principal, string dir, List<InsertUpdateDeleteArgs> args, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
string dir
List<InsertUpdateDeleteArgs> args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>
Overrides
WMDataSourceBase.DeleteData(WMPrincipal, string, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Dispose()

Declaration
public override void Dispose()
Overrides
WMDataSourceBase.Dispose()
Exceptions
Type Condition
NotImplementedException

FromDSType(string)

Declaration
public string FromDSType(string typeName)
Parameters
Type Name Description
string typeName
Returns
Type Description
string

GetCreateSQL(DataTable, bool, string)

Declaration
public string GetCreateSQL(DataTable dt, bool isTemporary = false, string tableName = null)
Parameters
Type Name Description
DataTable dt
bool isTemporary
string tableName
Returns
Type Description
string

GetSQLType(DataColumn, DataTable)

Declaration
public string GetSQLType(DataColumn col, DataTable dt)
Parameters
Type Name Description
DataColumn col
DataTable dt
Returns
Type Description
string

GetSchema(string)

Declaration
public DataTable GetSchema(string objectName)
Parameters
Type Name Description
string objectName
Returns
Type Description
DataTable

InsertData(WMPrincipal, string, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Inserts data into the data source. This method currently makes use of existing Evaluation infrastructure, but should be moved to a less cumbersome method whenever possible. It is assumed that args has been confirmed to both contain elements, and that each transactionID is the same, if any.

Declaration
public override Task<ElementValue> InsertData(WMPrincipal principal, string dir, List<InsertUpdateDeleteArgs> args, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
string dir
List<InsertUpdateDeleteArgs> args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>
Overrides
WMDataSourceBase.InsertData(WMPrincipal, string, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

IsNull(object)

Declaration
public static bool IsNull(object val)
Parameters
Type Name Description
object val
Returns
Type Description
bool

Open(string)

Open a transaction to the database specified in the connectionString parameter, or the ConnectionInfo property.

Declaration
public void Open(string connectionString = null)
Parameters
Type Name Description
string connectionString

OpenTransaction()

Attempt to open a new transaction

Declaration
public override string OpenTransaction()
Returns
Type Description
string
Overrides
WMDataSourceBase.OpenTransaction()

Read(WMDataReader, ElementValue)

Read writer from the associated writer source as per the specified writer reader.

Declaration
public override ElementValue Read(WMDataReader reader, ElementValue args_elementValue)
Parameters
Type Name Description
WMDataReader reader
ElementValue args_elementValue
Returns
Type Description
ElementValue
Overrides
WMDataSourceBase.Read(WMDataReader, ElementValue)

RollbackTransaction(string)

Roll back the transaction, if one is active.

Declaration
public override void RollbackTransaction(string id)
Parameters
Type Name Description
string id
Overrides
WMDataSourceBase.RollbackTransaction(string)

TestConnection(bool)

Tests whether a connection is currently possible to the database.

Declaration
public void TestConnection(bool closeAndDispose = true)
Parameters
Type Name Description
bool closeAndDispose

If set to true, the connection is closed and disposed after the method returns.

ToDSType(Type)

Declaration
public string ToDSType(Type t)
Parameters
Type Name Description
Type t
Returns
Type Description
string

UpdateData(WMPrincipal, string, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

Updates data in the data source. This method currently makes use of existing Evaluation infrastructure, but should be moved to a less cumbersome method whenever possible. It is assumed that args has been confirmed to both contain elements, and that each transactionID is the same, if any.

Declaration
public override Task<ElementValue> UpdateData(WMPrincipal principal, string dir, List<InsertUpdateDeleteArgs> args, WMAppDbContext? context = null)
Parameters
Type Name Description
WMPrincipal principal
string dir
List<InsertUpdateDeleteArgs> args
WMAppDbContext context
Returns
Type Description
Task<ElementValue>
Overrides
WMDataSourceBase.UpdateData(WMPrincipal, string, List<InsertUpdateDeleteArgs>, WMAppDbContext?)

ValidateTableName(string)

Modify the table name as necessary to ensure it complies with SQL Server's table naming rules.

Declaration
public static string ValidateTableName(string tableName)
Parameters
Type Name Description
string tableName
Returns
Type Description
string

Write(WMDataWriter, ElementValue)

Declaration
public override ElementValue Write(WMDataWriter writer, ElementValue args)
Parameters
Type Name Description
WMDataWriter writer
ElementValue args
Returns
Type Description
ElementValue
Overrides
WMDataSourceBase.Write(WMDataWriter, ElementValue)

Implements

IHasEncryptedValues
IWMDataSource
IWMAsset
IDbEntity
IWMEntity
IWMAssetDirectoryMember
IWMPrincipalOwned
IDisposable
IDocumentedEntity
INamedEntity
In this article
Back to top Copyright © 2025 Quantellia LLC.    Version 2.0.0 Revision 399     Last Updated 1/15/2025    DRAFT DOCUMENTATION. SUBJECT TO CHANGE