Ejemplo n.º 1
0
		//导出
		private void tsbExport_Click(object sender, EventArgs e)
		{
			if (BackDataSet.Tables.Count > 0)
			{
				Export FormE = new Export(BackDataSet);
				FormE.ShowDialog(this);
			}

			//Apq.Windows.Forms.Wizard w = new Apq.Windows.Forms.Wizard();
			//w.StepIndex = 0;
			//w.btnBack.Click += new EventHandler(btnBack_Click);
			//w.btnNext.Click += new EventHandler(btnNext_Click);
			//w.btnFinish.Click += new EventHandler(btnFinish_Click);
			//w.btnCancel.Click += new EventHandler(btnCancel_Click);

			//ShowExportForm(w, 0, 1);
		}
Ejemplo n.º 2
0
		private void tsbExport_Click(object sender, EventArgs e)
		{
			if (lstds.Count > 0)
			{
				DataSet ds = lstds[0].Copy();

				// 增加服务器名列
				foreach (DataTable dt in ds.Tables)
				{
					dt.Columns.Add("__DBIName");
					// 设置第一个数据集的服务器名
					// 设置服务器名
					foreach (DataRow dr in dt.Rows)
					{
						dr["__DBIName"] = ds.DataSetName;
					}
				}

				for (int i = 1; i < lstds.Count; i++)
				{
					ds.Merge(lstds[i]);
					// 设置服务器名
					foreach (DataTable dt in ds.Tables)
					{
						foreach (DataRow dr in dt.Rows)
						{
							if (Apq.Convert.LikeDBNull(dr["__DBIName"]))
							{
								dr["__DBIName"] = lstds[i].DataSetName;
							}
						}
					}
				}

				Export FormE = new Export(ds);
				FormE.ShowDialog(this);
			}
		}