durga prasad

durga prasad

  • NA
  • 54
  • 0

What is wrong with this one

Mar 24 2009 8:29 AM
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)