C# Class Rhetos.Utilities.SqlUtility

ファイルを表示 Open project: Rhetos/Rhetos Class Usage Examples

Private Properties

Property Type Description
ByteArrayToString string
GetDatabaseTimeFromDatabase System.DateTime
GetProviderNameFromConnectionString string
SetLanguageFromProviderName void
StringToByteArray byte[]

Public Methods

Method Description
BoolToString ( bool b ) : string
DateTimeToString ( System.DateTime dateTime ) : string
EmptyNullString ( System.Data.Common.DbDataReader dataReader, int column ) : string

Returns empty string if the string value is null. This function is used for compatibility between MsSql and Oracle string behavior.

ExtractUserInfo ( string contextInfo ) : IUserInfo
GetDatabaseTime ( ISqlExecuter sqlExecuter ) : System.DateTime
GetFullName ( string objectName ) : string
GetSchemaName ( string fullObjectName ) : string
GetShortName ( string fullObjectName ) : string
GuidToString ( System.Guid guid ) : string
Identifier ( string name ) : string

Throws an exception if 'name' is not a valid SQL database object name. Function returns given argument so it can be used as fluent interface. In some cases the function may change the identifier (limit identifier length to 30 on Oracle database, e.g.).

MaskPassword ( string connectionString ) : string
QuoteBool ( bool b ) : string
QuoteDateTime ( System.DateTime dateTime ) : string
QuoteGuid ( System.Guid guid ) : string
QuoteIdentifier ( string sqlIdentifier ) : string
QuoteText ( string value ) : string
ReadGuid ( System.Data.Common.DbDataReader dataReader, int column ) : System.Guid

Vendor-independent database reader.

ReadInt ( System.Data.Common.DbDataReader dataReader, int column ) : int

Vendor-independent database reader.

StringToGuid ( string guid ) : System.Guid
UserContextInfoText ( IUserInfo userInfo ) : string

Private Methods

Method Description
ByteArrayToString ( byte ba ) : string
GetDatabaseTimeFromDatabase ( ISqlExecuter sqlExecuter ) : System.DateTime
GetProviderNameFromConnectionString ( ) : string
SetLanguageFromProviderName ( string connectionStringProvider ) : void
StringToByteArray ( String hex ) : byte[]

Method Details

BoolToString() public static method

public static BoolToString ( bool b ) : string
b bool
return string

DateTimeToString() public static method

public static DateTimeToString ( System.DateTime dateTime ) : string
dateTime System.DateTime
return string

EmptyNullString() public static method

Returns empty string if the string value is null. This function is used for compatibility between MsSql and Oracle string behavior.
public static EmptyNullString ( System.Data.Common.DbDataReader dataReader, int column ) : string
dataReader System.Data.Common.DbDataReader
column int
return string

ExtractUserInfo() public static method

public static ExtractUserInfo ( string contextInfo ) : IUserInfo
contextInfo string
return IUserInfo

GetDatabaseTime() public static method

public static GetDatabaseTime ( ISqlExecuter sqlExecuter ) : System.DateTime
sqlExecuter ISqlExecuter
return System.DateTime

GetFullName() public static method

public static GetFullName ( string objectName ) : string
objectName string
return string

GetSchemaName() public static method

public static GetSchemaName ( string fullObjectName ) : string
fullObjectName string
return string

GetShortName() public static method

public static GetShortName ( string fullObjectName ) : string
fullObjectName string
return string

GuidToString() public static method

public static GuidToString ( System.Guid guid ) : string
guid System.Guid
return string

Identifier() public static method

Throws an exception if 'name' is not a valid SQL database object name. Function returns given argument so it can be used as fluent interface. In some cases the function may change the identifier (limit identifier length to 30 on Oracle database, e.g.).
public static Identifier ( string name ) : string
name string
return string

MaskPassword() public static method

public static MaskPassword ( string connectionString ) : string
connectionString string
return string

QuoteBool() public static method

public static QuoteBool ( bool b ) : string
b bool
return string

QuoteDateTime() public static method

public static QuoteDateTime ( System.DateTime dateTime ) : string
dateTime System.DateTime
return string

QuoteGuid() public static method

public static QuoteGuid ( System.Guid guid ) : string
guid System.Guid
return string

QuoteIdentifier() public static method

public static QuoteIdentifier ( string sqlIdentifier ) : string
sqlIdentifier string
return string

QuoteText() public static method

public static QuoteText ( string value ) : string
value string
return string

ReadGuid() public static method

Vendor-independent database reader.
public static ReadGuid ( System.Data.Common.DbDataReader dataReader, int column ) : System.Guid
dataReader System.Data.Common.DbDataReader
column int
return System.Guid

ReadInt() public static method

Vendor-independent database reader.
public static ReadInt ( System.Data.Common.DbDataReader dataReader, int column ) : int
dataReader System.Data.Common.DbDataReader
column int
return int

StringToGuid() public static method

public static StringToGuid ( string guid ) : System.Guid
guid string
return System.Guid

UserContextInfoText() public static method

public static UserContextInfoText ( IUserInfo userInfo ) : string
userInfo IUserInfo
return string