Quantcast
Channel: Visual C# forum
Viewing all articles
Browse latest Browse all 31927

how to prevent a deadlock

$
0
0

hello guys i have a database method for ExecuteNonQuery, can you please help me how to modified my method to prevent deadlock while executing some query in database?

public int DBexecuteNonQuery(string exec)
        {
            int retint = 0;
            DBopen();

                try
                {
                    sqlcom = new SqlCommand(exec, this.sqlconn);
                    retint = sqlcom.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    throw new ApplicationException(e.Message);
                }
                finally
                {
                    DBclose();
                }

            return retint;
        }
thanks and godbless


auwi


Viewing all articles
Browse latest Browse all 31927

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>