C# Класс com.rusanu.DBUtil.SqlCmd

Class for sqlcmd functionality
Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Dispose ( ) : void
ExecuteFile ( string filePath, string basePath = null ) : bool

Executes a SQL file, from the file path

ExecuteFile ( SqlConnection conn, string filePath ) : void

Executes a SQL file on the given connection

ExecuteReader ( TextReader file, string basePath = null ) : bool

Executes a SQL file, from a TextReader

ExecuteStream ( Stream stream, string basePath = null ) : bool

Executes a SQL file from a stream

ExecuteStream ( SqlConnection conn, Stream stream ) : void
SqlCmd ( SqlConnection conn ) : System

Constructor

Приватные методы

Метод Описание
ConnectCommand ( string line ) : void
ExecuteBatch ( string batch, uint count ) : bool
GetFullFilePath ( string filePath, string basePath ) : string
OnErrorCommand ( string line ) : void
RunCommand ( string line, string basePath ) : void
SetVarCommand ( string line ) : void
ShellCommand ( string line ) : void

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

ExecuteFile() публичный Метод

Executes a SQL file, from the file path
public ExecuteFile ( string filePath, string basePath = null ) : bool
filePath string The SQL file to execute
basePath string /// The base path to use to qualify relative path of any included files that are to be executed. /// If not supplied this will default to the directory path containing ///
Результат bool

ExecuteFile() публичный статический Метод

Executes a SQL file on the given connection
public static ExecuteFile ( SqlConnection conn, string filePath ) : void
conn System.Data.SqlClient.SqlConnection Connection to execute the file on
filePath string
Результат void

ExecuteReader() публичный Метод

Executes a SQL file, from a TextReader
public ExecuteReader ( TextReader file, string basePath = null ) : bool
file TextReader The SQL file to execute, as a TextReader
basePath string The base path to use to qualify relative path of any included files that are to be executed
Результат bool

ExecuteStream() публичный Метод

Executes a SQL file from a stream
public ExecuteStream ( Stream stream, string basePath = null ) : bool
stream Stream The SQL file to execute, as a Stream
basePath string The base path to use to qualify relative path of any included files that are to be executed
Результат bool

ExecuteStream() публичный статический Метод

public static ExecuteStream ( SqlConnection conn, Stream stream ) : void
conn System.Data.SqlClient.SqlConnection
stream Stream
Результат void

SqlCmd() публичный Метод

Constructor
public SqlCmd ( SqlConnection conn ) : System
conn System.Data.SqlClient.SqlConnection The SQL Connection used to execute the SQL batches
Результат System