GridCtrl控件的使用

来源:互联网 发布:人工智能上市龙头公司 编辑:程序博客网 时间:2024/05/02 05:02

GridCtrl中删除一行,自动在数据中删除一行,可以在控件上更新数据库中的记录.

http://www.codeproject.com/miscctrl/mfcgriddatabaseversion.asp?df=100 下载类

将DbMFCGrid.cpp和DbMFCGrid.h放到工程目录下,

在.h文件中

CDbMFCGrid m_Grid

在.CPP文件中

m_Grid.m_strDataSource="Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=CISSQLDB;Data Source=(local);Use Procedure for Prepare=1;Auto Translate=True; Packet Size=4096;Use Encryption for Data=False;Tag with column collation when possible=True";

m_Grid.Bind();

 m_Grid.FillGrid();