実際、私のデータベース接続は次のようになっています...では、接続プールを紹介します。このための書き方を教えてもらえますか...、
public static string dbpath()
{
try
{
string strcon = @"Data Source=local\SQLEXPRESS;Initial Catalog=aniv;Integrated Security=True";
SqlConnection con = new SqlConnection(strcon);
if (con.State == ConnectionState.Open)
{
con.Close();
}
con.Open();
return strcon;
}
catch (SqlException ex)
{
MessageBox.Show(ex.Message);
return "0";
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return "0";
}
}