摘要: SET autocommit=0是关闭自动提交SET autocommit=1是开启自动提交,默认是开启的如果没有关闭自动提交话,写事务的时候,会出现如下问题,例如有三个insert 语句,前两条没有问题,第三条出现问题话,那么前两条提交成功了,第三条失败,往往我们不希望这样。如果关闭自动提交的话,... 阅读全文
posted @ 2014-04-16 14:09 腰里揣着一块砖 阅读(716) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Data;using System.Data.SqlClient;using System.Configuration;namespace DAL{ public class DBHelper { private static SqlConnection con; private static string conString = ConfigurationManag... 阅读全文
posted @ 2012-04-05 22:59 腰里揣着一块砖 阅读(191) 评论(0) 推荐(0) 编辑
摘要: public static void ExportToExcel(ListView pListView) { if (pListView.Items == null) return; string saveFileName = ""; SaveFileDialog saveDialog = new SaveFileDialog(); saveDialog.DefaultExt = "xls"; saveDialog.Filter = "Excel文件|*.xls"; ... 阅读全文
posted @ 2012-03-08 00:01 腰里揣着一块砖 阅读(288) 评论(0) 推荐(0) 编辑
摘要: private void button1_Click(object sender, EventArgs e) { //选择要备份的路径 this.folderBrowserDialog1.ShowDialog(); this.txtDbBackup.Text = folderBrowserDialog1.SelectedPath; } private void btnChooseOK_Click(object sender, EventArgs e) { ... 阅读全文
posted @ 2012-03-07 23:46 腰里揣着一块砖 阅读(1172) 评论(3) 推荐(1) 编辑