private Boolean CreateCommand(string Query)
{
try
{
/*con is a object of Connection Class*/
OleDbCommand com = new OleDbCommand();
//or
MySqlCommand com = new MySqlCommand();
//or
SqlCommand com = new SqlCommand();
com.Connection = con;
com.CommandText = Query;
com.ExecuteNonQuery();
return com;
}
catch (Exception ex)
{
throw ex;
}
}
public Boolean ExecutQuery(string Query)
{
try
{
CreateCommand(Query);
return true;
}
catch (Exception ex)
{
throw ex;
}
}
No comments:
Post a Comment