C# Async Database Wrapper with Presentaion Framework (WPF) test UI
Exposes 3 basic functions
The method inputs are same for all three
- First parameter takes the SQL query as
string
- use
@param
to add parameterized values
- use
- Second parameter takes list of values as
Dictionary<string,string>
- the key is the parameter name
- the valueis the parameter value
Calls the System.Data.SqlClient.SqlCommand.ExecuteReader
method
Use this for SELECT queries that returns multiple columns and/or multiple rows
Returns the entire result set as a System.Data.DataTable
Calls the System.Data.SqlClient.SqlCommand.ExecuteScalar
method
Use this for SELECT queries that returns a single column and a single row, or none
Returns an object
that must be casted to the desired data type
Calls the System.Data.SqlClient.SqlCommand.ExecuteNonQuery
method
Use this for UPDATE and DELETE queries that does not return a result set
Returns the number of affected rows, -1 if error, 0 is no changes