Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» NewBlueFx TotalFX Windows-FL | 1.11 GB
Tue Dec 17, 2013 12:42 pm by titquarra

» Celebrity.Sex.Tape.UNCUT.&.UNRATED.2012.720p.BRrip.x264.YIFY.mp4
Tue Dec 17, 2013 8:32 am by titquarra

» Maya Autodesk Personal Learning Edition 8.5
Tue Dec 17, 2013 7:47 am by titquarra

» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

Shopmotion


Affiliates
free forum


Code thêm xóa sửa tìm kiếm trong c#

View previous topic View next topic Go down

Code thêm xóa sửa tìm kiếm trong c#

Post  Admin on Thu Apr 21, 2011 7:10 pm

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows.Forms;

namespace BCTN.BLL
{
class KhoBaoChe
{

DAL.KetnoiCSDL da = new DAL.KetnoiCSDL();
public void ThemKBC(string _MaKho, string _TenKho)
{
string sql = "insert into KHOBAOCHE values(N'" + _MaKho + "',N'" + _TenKho + "')";
da.ExcuteNonQuery(sql);
}

public void XoaKBC(string _MaKho)
{
string sql = "Delete From KHOBAOCHE where MAKBC= '" + _MaKho + "'";
da.ExcuteNonQuery(sql);
}

public void SuaKBC(string _MaKho, string _TenKho)
{
string sql = "Update KHOBAOCHE set TENKBC= '" + _TenKho + "' where MAKBC= '" +_MaKho +"'";
http://MessageBox.Show(sql);
da.ExcuteNonQuery(sql);
}

//public DataTable SearchMAVT(string _MaVT)
//{
// string sql = "Select * from VITHUOC where MAVT like '%" + _MaVT + "%'";
// return da.GetTable(sql);
//}

//public DataTable SearchTENVT(string _TenVT)
//{
// string sql = "Select * from VITHUOC where TENVT like '%" + _TenVT + "%'";
// return da.GetTable(sql);
//}

public DataTable HienThiKBC()
{
string sql = "select * from KHOBAOCHE";
return da.GetTable(sql);
}
}
}

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

Re: Code thêm xóa sửa tìm kiếm trong c#

Post  Admin on Thu Apr 21, 2011 7:11 pm

thực chất của câu lệnh tìm kiếm là câu lệnh select có where thui Very Happy Very Happy Very Happy

Code:
"Select * from VITHUOC where TENVT like '%" + _TenVT + "%'"


Idea Idea Idea Idea

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum