printDocument 引起的BUG!! 一但使用this.printDocument1.Print();就会出现"Microsoft Jet 数据库引擎找不到输入表或查询...."错误!!printDocument1_PrintPage()方法内没有任何代码都出现这个错误!!但是注释掉this.printDocument1.Print();错误就不回出现!!请高手指点这是什么原因??? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 最核心的代码,不需要初始化窗体的代码。另外不要说得那么惊心动魄,什么bug之类的。我们用得挺好的。 private void button3_Click(object sender, EventArgs e) { Form2 frmprogressBar = new Form2(); //自动加载图像页面 if (bInert) { if (DialogResult.Yes == (MessageBox.Show("是否打印数据资料", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question))) { frmprogressBar.Show(); i++; string[] row0 ={ i.ToString(), tLable.intoLable01, tLable.intoLable03, tLable.intoLable05, tLable.intoLable06 + "-" + tLable.intoLable07, tLable.intoLable08, tLable.intoLable09, tLable.intoLable10, tLable.intoLable11 }; DataGridViewRowCollection drow = this.dataGridView1.Rows; drow.Insert(0, row0); this.dataGridView1.Rows[0].Selected = true; this.prjuser.ProjectName = tLable.intoLable03; this.prjuser.CarNum = tLable.intoLable01; this.prjuser.StartSite = tLable.intoLable06; this.prjuser.EndSite = tLable.intoLable07; this.prjuser.MileagePlyes = int.Parse(tLable.intoLable08.ToString()); this.prjuser.OverRunClass = tLable.intoLable04; this.prjuser.OverRunNum = float.Parse(tLable.intoLable05.ToString()); this.prjuser.Unit = "吨/公里"; this.prjuser.UnitPrice = float.Parse(dBZ.ToString()); this.prjuser.PrjMoney = float.Parse(this.tLable.intoLable05) * float.Parse(this.tLable.intoLable08) * dBZ; this.prjuser.Decs = tLable.intoLable11; this.prjuser.GreatTime = DateTime.Now; this.prjuser.userName = sAcc; dbconn.saveUser(this.prjuser); this.printDocument1.Print(); //出错,注释掉后,无错误!print内没有任何代码! this.txtCheHAo1.Text = ""; this.txtPay1.Text = ""; this.txtCheWeight1.Text = ""; this.txtTonnage1.Text = ""; this.cmbAdrr1.SelectedIndex = 0; this.cmbAdrr2.SelectedIndex = 0; for (int n = 0; n < this.checkedListBox1.Items.Count; n++) { this.checkedListBox1.SetItemCheckState(n, CheckState.Unchecked); } this.checkedListBox1.ClearSelected(); bInert = false; } } else { MessageBox.Show("只有添加数据资料后才能打印数据资料", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } frmprogressBar.Close(); } 还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079 还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079 你说的Bug是没有,你使用的有问题倒是有的。问题描述的不清楚。先照着书谢谢例程,再说。 关键是this.printDocument1打印也正常,就是使用了this.printDocument1后出现数据库Microsoft Jet 数据库引擎找不到输入表或查询....这个错误!!去掉this.printDocument1后就不会出现这个问题!!而且为了调试我this.printDocument1内没有任何代码也出错!郁闷!! 顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079 顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079 顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727 顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727 顶一下!!免的沉底了!!还是那个这个问题的帖子!!!不过沉地了!!http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727 IIS 环境中为什么不能执行cmd命令? 请问,WebBrowser怎么将网页缩小 【是否可以用属性代替方法,有何利弊】 引用水晶报表dll文件 关于Com组件的问题 C# DataGrid中如何使用函数? 请问windows API的详细信息到那里去看啊? C#如何判定服务器上指定的exe程序是否正在运行? 为什么不能通过Location改变窗口的默认位置,应该怎么做呢??? 请大家帮我看这一段代码,(数组的维数问题) .net出现怪现象,大虾帮忙! 求一SQL 语句
另外不要说得那么惊心动魄,什么bug之类的。我们用得挺好的。
{
Form2 frmprogressBar = new Form2(); //自动加载图像页面
if (bInert)
{
if (DialogResult.Yes == (MessageBox.Show("是否打印数据资料", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question)))
{
frmprogressBar.Show();
i++;
string[] row0 ={ i.ToString(), tLable.intoLable01, tLable.intoLable03, tLable.intoLable05, tLable.intoLable06 + "-" + tLable.intoLable07, tLable.intoLable08, tLable.intoLable09, tLable.intoLable10, tLable.intoLable11 };
DataGridViewRowCollection drow = this.dataGridView1.Rows;
drow.Insert(0, row0);
this.dataGridView1.Rows[0].Selected = true; this.prjuser.ProjectName = tLable.intoLable03;
this.prjuser.CarNum = tLable.intoLable01;
this.prjuser.StartSite = tLable.intoLable06;
this.prjuser.EndSite = tLable.intoLable07;
this.prjuser.MileagePlyes = int.Parse(tLable.intoLable08.ToString());
this.prjuser.OverRunClass = tLable.intoLable04;
this.prjuser.OverRunNum = float.Parse(tLable.intoLable05.ToString());
this.prjuser.Unit = "吨/公里";
this.prjuser.UnitPrice = float.Parse(dBZ.ToString());
this.prjuser.PrjMoney = float.Parse(this.tLable.intoLable05) * float.Parse(this.tLable.intoLable08) * dBZ;
this.prjuser.Decs = tLable.intoLable11;
this.prjuser.GreatTime = DateTime.Now;
this.prjuser.userName = sAcc;
dbconn.saveUser(this.prjuser); this.printDocument1.Print(); //出错,注释掉后,无错误!print内没有任何代码! this.txtCheHAo1.Text = "";
this.txtPay1.Text = "";
this.txtCheWeight1.Text = "";
this.txtTonnage1.Text = "";
this.cmbAdrr1.SelectedIndex = 0;
this.cmbAdrr2.SelectedIndex = 0;
for (int n = 0; n < this.checkedListBox1.Items.Count; n++)
{
this.checkedListBox1.SetItemCheckState(n, CheckState.Unchecked);
}
this.checkedListBox1.ClearSelected();
bInert = false;
}
}
else
{
MessageBox.Show("只有添加数据资料后才能打印数据资料", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
frmprogressBar.Close();
}
http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079
http://community.csdn.net/Expert/topic/5153/5153599.xml?temp=.2374079
问题描述的不清楚。先照着书谢谢例程,再说。
http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727
http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727
http://community.csdn.net/Expert/topic/5188/5188998.xml?temp=.2444727