public int Update(tblQuestionPaperMst obj)
 {
     if (cnnstr.State == ConnectionState.Closed)
     {
         cnnstr.Open();
     }
     sql  = "Update tblQuestionPaperMst set PaperType = '" + obj.PaperType + "' where QPID = " + obj.QPID + " ";
     scmd = new SqlCommand(sql, cnnstr);
     scmd.ExecuteNonQuery();
     cnnstr.Close();
     return(1);
 }
 public int Delete(tblQuestionPaperMst obj)
 {
     if (cnnstr.State == ConnectionState.Closed)
     {
         cnnstr.Open();
     }
     sql  = "delete from tblQuestionPaperMst where QPID = " + obj.QPID + "";
     scmd = new SqlCommand(sql, cnnstr);
     scmd.ExecuteNonQuery();
     cnnstr.Close();
     return(1);
 }
 public int Insert(tblQuestionPaperMst obj)
 {
     if (cnnstr.State == ConnectionState.Closed)
     {
         cnnstr.Open();
     }
     sql  = "Insert Into tblQuestionPaperMst (PaperType) values ('" + obj.PaperType + "')";
     scmd = new SqlCommand(sql, cnnstr);
     scmd.ExecuteNonQuery();
     cnnstr.Close();
     return(1);
 }
        public DataTable GetSingleRecord(tblQuestionPaperMst obj)
        {
            if (cnnstr.State == ConnectionState.Closed)
            {
                cnnstr.Open();
            }
            sql = "Select * from tblQuestionPaperMst where QPID = " + obj.QPID + "";
            SqlDataAdapter adp = new SqlDataAdapter(sql, cnnstr);
            DataTable      dt  = new DataTable();

            adp.Fill(dt);
            cnnstr.Close();
            return(dt);
        }