6
Reply

What is wrong with this one

durga prasad

durga prasad

Mar 24 2009 8:29 AM
5.2k
Hi, 
What is wrong with this one

  SqlConnection con = new SqlConnection("Server=.\\SQLExpress;Database=patient;uid=sa;pwd=;");
            String Query;
            Query = "Delete from PatientRecords where PatientID='" + TextBox1.Text + "'";
            SqlCommand sqlcmb = new SqlCommand();
            con.Open();
            sqlcmb.Connection = con;

            SqlTransaction sqltran;
            sqltran = con.BeginTransaction();

            sqlcmb.Transaction = sqltran;
            sqlcmb.CommandText = Query;
            sqlcmb.ExecuteNonQuery();

Thanks in Advance,
A.Durga Prasad

Answers (6)