SqlHelperExecuteSqlCommand Method (String, String, String) |
Namespace: Ocaramba.Helpers
public static ICollection<string> ExecuteSqlCommand( string command, string connectionString, string column )
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);