示例#1
0
 public void Insert(SachTacGia info)
 {
     cnn = helper.GetConnect();
     sqlString = "Insert into SachTacGia(id, MaSach, MaTacGia) values ('" + info.Id + "',N'" + info.MaSach + "','" + info.MaTacGia + "')";
     try
     {
         //Thực thi câu lệnh SQL
         cmd = new SqlCommand(sqlString, cnn);
         cmd.ExecuteNonQuery();
     }
     catch (System.Exception e)
     {
         cnn.Close();
         throw new Exception("Lỗi Kết Nối Cơ sở dữ liệu.");
     }
     cnn.Close();
 }
示例#2
0
 public void Update(SachTacGia info)
 {
     stgD.Update(info);
 }
示例#3
0
 public void Update(SachTacGia info)
 {
     sqlString = "UPDATE SACHTACGIA SET MaTacGia='" + info.MaTacGia +
         "',MaSach='"+info.MaSach+
         "' WHERE id='" + info.Id + "'";
     cnn = helper.GetConnect();
     try
     {
         //Thực thi câu lệnh SQL
         cmd = new SqlCommand(sqlString, cnn);
         cmd.ExecuteNonQuery();
     }
     catch (System.Exception e)
     {
         cnn.Close();
         throw new Exception("Lỗi Kết Nối Cơ sở dữ liệu.");
     }
     cnn.Close();
 }
示例#4
0
 public void Insert(SachTacGia info)
 {
     stgD.Insert(info);
 }