A
ad
I have a function call MyExecuteNonQuery(see bellow)
When I call it with some Sql command like:
MyExecuteNonQuery("Delete from myTable);
Will it close the conneciton which opened in MyExecuteNonQuery?
----------------------------------------------------------------------------
public int object MyExecuteNonQuery(string sSql)
{
string cnnStr="....";
SqlConnection cnn = new SqlConnection(cnnStr);
SqlCommand myCommand = new SqlCommand(sSql, cnn);
cnn.Open();
int iRV=myCommand.ExecuteNonQuery;
return iRV;
}
/*
When I call it with some Sql command like:
MyExecuteNonQuery("Delete from myTable);
Will it close the conneciton which opened in MyExecuteNonQuery?
----------------------------------------------------------------------------
public int object MyExecuteNonQuery(string sSql)
{
string cnnStr="....";
SqlConnection cnn = new SqlConnection(cnnStr);
SqlCommand myCommand = new SqlCommand(sSql, cnn);
cnn.Open();
int iRV=myCommand.ExecuteNonQuery;
return iRV;
}
/*