direct SQL execution to get count using Enterprise library
<p>I am new to asp.net development and using enterprise library in my application in the following way.</p>

<pre><code> Database db = DatabaseFactory.CreateDatabase();

            DbCommand cmd = db.GetStoredProcCommand("sp_MakePayment");

            db.AddInParameter(cmd, "@BillGenID", System.Data.DbType.Int32);
            db.SetParameterValue(cmd, "@BillGenID", billgenID);

            db.AddInParameter(cmd, "@PayDate", System.Data.DbType.String, 50);
            db.SetParameterValue(cmd, "@PayDate", mypaydate.Text);

            db.AddInParameter(cmd, "@TransNo", System.Data.DbType.String, 50);
            db.SetParameterValue(cmd, "@TransNo", transno.Text);

            db.AddInParameter(cmd, "@AmtToPay", System.Data.DbType.Double);
            db.SetParameterValue(cmd, "@AmtToPay", Convert.ToDouble(paidamount.Text));


            ////Execute Stored Procedure
            int i = 0;
            i = db.ExecuteNonQuery(cmd);
</code></pre>

<p>Now I am in a situation where i need to run this inlnie query using the same method to get the count of records and read in a variable. for example following query to find existing bill.</p>

<pre><code>string bill_id = "1234";
string dofpayment = "11/03/2011";

 mysql = "Select count(*) from payments where bill_id = " + bill_id + " and payment_date = " + dofpayment ;
</code></pre>

<p>Now how to incorporate the above lines using the enterprise library block.</p>

<p>thanks</p>
