VS2013 MFC ODBC connection SQL Server database programming (iii)
Reprint Please specify: http://blog.csdn.net/my_acm/article/category/2616577
Following the previous article on the database links and some instructions, this article will be implemented in the database and other operations such as adding and deleting.
As shown is a simple small program that is finalized.
First, add the Nm_click Responder for the list box. Mouse over the list box, right-click Add event handler, locate the Mn_click message, add and edit as shown in.
Add the following code to the response function:
This is done, click on a record in the list box, the record ID and name are displayed in the edit box.
Bind the variable M_class for combo box and add the following code to the initialization function;
Double-click the Add button and add the following code:
Double-click the Delete button and add the following code:
Set the 3 radio buttons to the same group and bind the int variable, right-click on the first radio button to add an event handler
Then manually add an event handler for the other two radio buttons, such as:
Add in the Change function:
Double-click the Query button to add the following code:
Double-click the Modify button to add the following code:
Finally, add exit and show All programs separately:
All features are now added to completion.
VS2013 MFC ODBC connection SQL Server database programming (iii)