a simple way to manipulate data using sql
public static DataTable ExecuteSQL(string sql, Dictionary parameters) { DataTable dt = new DataTable("DataTable"); using (SqlConnection myConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ipropertydb_localConnectionString"].ConnectionString)) { myConnection.Open(); SqlCommand mySqlCommand = new SqlCommand(sql, myConnection); if (parameters != null) { foreach (KeyValuePair p in parameters) { mySqlCommand.Parameters.AddWithValue(p.Key, p.Value); } } using (SqlDataReader datareader = mySqlCommand.ExecuteReader()) { dt.Load(datareader); } } return dt; }