Methods
PainlessADO currently includes the SQL class, which simplify the use of basics SQL functions. It allows you to quickly connect to a sql database and execute queries with or without parameters in your C# code.
Methods and descriptions
Return Type
SQL(string serverSource, string dataBaseName, string userID, string password) Create new sql connection and open this connection, using Integrated Security
-
SQL(string serverSource, string dataBaseName) Create new sql connection and open this connection with user name and password
-
Connect() Opens a connection to the server
void
Close() Closes an open connection
void
GetDataReader(string query) Sends a query to the database and builds a SqlDataReader that can be used to get each records one at a time
DataReader
GetDataReader(string query, params string[] sqlParameters) Sends a query with parameters to the database and builds a SqlDataReader
DataReader
RetrieveAllData(string query) Execute a query without parameters and return all data in a DataTable.
DataTable
RetrieveAllData(string query, params string[] sqlParameters) Execute a query with parameters and return all data in a DataTable.
DataTable
ExecuteScalar(string query) Execute a query without parameters and return all data in a DataTable.
Object
ExecuteScalar(string query, params string[] sqlParameters) Execute a query with parameters and return all data in a DataTable.
Object
ExecuteNonQuery(string query) Executes a command - without parameters - that doesn't retrieve any data from the database.
int
ExecuteNonQuery(string query, params string[] sqlParameters) Executes a command - with parameters - that doesn't retrieve any data from the database.
int
Last updated
Was this helpful?