Click or drag to resize

SqlHelperExecuteSqlCommand(String, String, String) Method

Framework to automate tests using Selenium WebDriver
Method is used for execution SQL query (select) and reading each row from column.

Namespace: Ocaramba.Helpers
Assembly: Ocaramba (in Ocaramba.dll) Version: 1.0.0+d8e789f8644d1a9b63485ad7914acf4f489f3ef9
Syntax
C#
public static ICollection<string> ExecuteSqlCommand(
	string command,
	string connectionString,
	string column
)
Request Example

Parameters

command  String
SQL query.
connectionString  String
Server, user, pass.
column  String
Name of column.

Return Value

ICollectionString
Collection of each row existed in column.
Example
How to use it:
C#
var connectionString = "User ID=sqluser;Password=sqluserpassword;server=servername;";
const string ColumnName = "AccountNumber";
const string SqlQuery = "SELECT  AccountNumber as " + ColumnName + " FROM [AdventureWorks].[Sales].[Customer] where [CustomerID] in (1, 2)";
var result = SqlHelper.ExecuteSqlCommand(SqlQuery, connectionString, ColumnName);
See Also