oclockvn
4/6/2015 - 10:06 AM

3layerdatahelper.cs

public class DataHelper
{
	private static SqlConnection _connection = null;

	public DataHelper()
	{
		var connStr = ConfigurationManager.AppSettings["ConnectionString"];
		_connection = new SqlConnection(connStr);
	}

	/// <summary>
	/// Execute select query
	/// </summary>
	/// <param name="query">a string of select query</param>
	/// <returns>DataTable of query</returns>
	/// <exception cref="Something went wrong"></exception>
	public DataTable ExecuteQuery(string query)
	{
		// todo
		return null;
	}

	/// <summary>
	/// Execute insert, update, delete query
	/// </summary>
	/// <param name="query">a query string</param>
	/// <exception cref="Something went wrong"></exception>
	public void ExecuteNonQuery(string query)
	{
		// todo
	}
}