Quantcast
Channel: MySQL Forums - Connector/NET and C#, Mono, .Net
Viewing all articles
Browse latest Browse all 1447

question about open and close of MySqlConnection (no replies)

$
0
0
hi
i'd like to ask a question.

MySqlConnection connection = newMySqlConnection(stringConnection);
MySqlCommand cmd = connection.CreateCommand();
connection.Open();
and i have a try catch. accoding to your opinion, i should put connection.Close() in the block of try,or outside of block of try?
according to you,if i open the connection and do not close,is it bad?or i open 2 times(using different istancse,like connection1 and connecton2),is it ok?
thank u very much
best regards
martin

Viewing all articles
Browse latest Browse all 1447


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