I'm, not even going to ask what this code is being used for. It looks wrong for whatever purpose you intend.
1) You've got two Qry variables, neither of which are properly named to describe what they are used for.
2) You can seemingly execute BOTH queries, of which they will both use the same set of parameter objects.
3) Your parameters are coming from somewhere else in the class and not from being passed in via the method arguments.
4) Your "parameter" variable is also not properly named as it's not describing a collection of parameter objects.
5) Your outside try/catch block, well, has no catch block!
But, on to the question at hand. You never committed the transaction upon successful completion of the query.
Oh, and you're missing a few closing curly braces near the bottom of the code.
Your modified code should look more like this:
protected boolExecuteQry(string Qry,string Qry1)
{
try
{
using (SqlConnection myCon = DBCon)
{
myCon.Open();
SqlTransaction tr = myCon.BeginTransaction();
try
{
if (Qry != "")
{
SqlCommand myCommand = new SqlCommand(Qry, myCon, tr);
myCommand.CommandType = CommandType.Text;
foreach (SqlParameter Parameter in parameter)
{
myCommand.Parameters.AddWithValue(Parameter.ParameterName, Parameter.Value);
}
myCommand.ExecuteNonQuery();
}
if (Qry1 != "")
{
SqlCommand myCommand = new SqlCommand(Qry1, myCon, tr);
myCommand.CommandType = CommandType.Text;
foreach (SqlParameter Parameter in parameter)
{
myCommand.Parameters.AddWithValue(Parameter.ParameterName, Parameter.Value);
}
myCommand.ExecuteNonQuery();
}
tr.Commit();
}
catch(Exception ex)
{
tr.Rollback();
ex.ToString();
}
}
}
catch (Exception ex)
{
}
}