From 5b24a43ec282b722f20be8dc56d01581f4e3510b Mon Sep 17 00:00:00 2001 From: "nelson.kai" Date: Tue, 15 Nov 2022 19:21:22 +0800 Subject: [PATCH] 2022/11/15 Updated --- .vs/ExportDataToFile/v16/.suo | Bin 56832 -> 144896 bytes Form1.Designer.cs | 94 ++++-- Form1.cs | 316 +++++++++++++----- ...gnTimeResolveAssemblyReferencesInput.cache | Bin 21502 -> 21526 bytes ...rtDataToFile.csproj.GenerateResource.cache | Bin 1070 -> 1070 bytes 5 files changed, 290 insertions(+), 120 deletions(-) diff --git a/.vs/ExportDataToFile/v16/.suo b/.vs/ExportDataToFile/v16/.suo index 6df010c95f6749ba67e6ebc7d852eb2d48896ce8..0467867f0a7d5503fa692aa5ab5b81bc1a4dc588 100644 GIT binary patch literal 144896 zcmeHw4PYGAb?%5?^OHxw34|1gP=WBHT~^ZS&tO2_m23ygmRZSmV2N3+M)Jxlt=L`J z7M6(#!6l)9LqZzTLh8nC(vZ-kZPKJA4IzF>+av_q{P5bBy#Dc%pEi%YV+-JXa_CFr_%$xs7a~#)cCu+YsdYX2M z?f!|lK0*F|y{4UxYu@|S(W6Iso7XLXs{y#xIO+fcH)$#S%WBP9zc!6?TAM@bsUPQR zC+FJQSLU_->+Wg$*H@o!3NYO|k$4C>rnE_IJ#rt%Rll~U%vbUsp9_k#qdEVn`!5nJ z$k#Yz{>*nqOQHm6O$S7Pix@yR(-k{iQbqoMgpa+=>`0rmS>%$`5~x36!j^Lwchbc& zHt!?AF3m}QE2fPh12#{$u;(8Nc z2(TG&6CeT@28;l<0JZ|Q0d5BHy{LH}HP7-}@;qkVC%ugWCICAC3BV*^Ctw;N)2DDf z1GpVP8p!~%fLXvUz-|D05_|I;Ft652j_`m%lH?HT%2l|8F&)v9B`?`#<}9 z(EKgm<2&~L&-Hpk3KZ)}f0e=bj65uJo zmjO=$z5+M`VEV7({5A91o*%EjiTlq0z6E#|@FT##0R9f}&w%d$z65RuVZ3@!Y5M;eL#@LvFi%l3= z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7a~rF@Uy;kQ>GBD30C4_*U`_M$_J?!Gk4H;_^v|7PbqZ8%|I{zlETPmo7ks*w;f_ zN$sVrC>N<4*#pUT$3<2g6GuA{M{m$|K79J|*XPwOYg~Mgu0#B1gIe0~qWr4Zf0^E% ze}r7i#c!S2|7sp!Kc<&8^3@x$|I;9Eh4AYRj#e&uW5afNw};^k;Ocsl43fYB$Q#U1 zdHs;9seGUBZj#h_1+s-BNlp@bjzDDRI5}VBUx5O6n^t+yNpi%q1CS-A_JhSqb%fbZ z-e^BQ0Q2D|%R24K=a3KB5fviHaPD?mE?MOB--~(gy z4uo$vAJ4_Xb^b-fdCXF}bT3_xuRDMH(P&u<*Pd^@{49iDN8{-mt~uWjv2u)jR>b+r z3BqWQN6_VLh`NN4sR3oIt8Ng2Y$w@s{&=Wjq?j^Nj&>RWdDV?=;K1O?J1qfslqJ$N zB3~{4-Njq=qMqW@@J^t3{u8Ja$v$%9aMs>YHI9b{GCTK6%QR*T5(OuPApRSI>mq$| zYP~rHX~#EDoM$qpoLqbVXS=qY-r9c3G*s?gX--Qsn$rfS57CSzr0gHzBHH%N(zv?v z>XVNztGv|uZn?BC@yx=QZMVJl;FL4>J>4Ib@fCf&hjoV0U)Oz6#(Y FzX18x$f5uM diff --git a/Form1.Designer.cs b/Form1.Designer.cs index 8ff41d1..906fbd0 100644 --- a/Form1.Designer.cs +++ b/Form1.Designer.cs @@ -57,14 +57,15 @@ namespace ExportDataToFile this.dgvExportList = new System.Windows.Forms.DataGridView(); this.label11 = new System.Windows.Forms.Label(); this.dgvColumnMapping = new System.Windows.Forms.DataGridView(); - this.txtWhere = new System.Windows.Forms.TextBox(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.cbTargetTable = new System.Windows.Forms.ComboBox(); this.clExpColumn = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.clClean = new System.Windows.Forms.DataGridViewButtonColumn(); this.clSourceColumn = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.clTargetColumn = new System.Windows.Forms.DataGridViewComboBoxColumn(); + this.txtWhere = new System.Windows.Forms.TextBox(); + this.label13 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.cbTargetTable = new System.Windows.Forms.ComboBox(); + this.btnMapping = new System.Windows.Forms.Button(); this.clExport = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.clCancel = new System.Windows.Forms.DataGridViewButtonColumn(); this.clSourceTable = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -381,11 +382,42 @@ namespace ExportDataToFile this.dgvColumnMapping.Location = new System.Drawing.Point(1297, 180); this.dgvColumnMapping.Name = "dgvColumnMapping"; this.dgvColumnMapping.RowTemplate.Height = 25; - this.dgvColumnMapping.Size = new System.Drawing.Size(487, 373); + this.dgvColumnMapping.Size = new System.Drawing.Size(487, 342); this.dgvColumnMapping.TabIndex = 45; this.dgvColumnMapping.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvColumnMapping_CellContentClick); this.dgvColumnMapping.CellEndEdit += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvColumnMapping_CellEndEdit); // + // clExpColumn + // + this.clExpColumn.HeaderText = "匯出"; + this.clExpColumn.Name = "clExpColumn"; + this.clExpColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.clExpColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.clExpColumn.Width = 65; + // + // clClean + // + this.clClean.HeaderText = "清除"; + this.clClean.Name = "clClean"; + this.clClean.Width = 50; + // + // clSourceColumn + // + this.clSourceColumn.DataPropertyName = "COLUMN_NAME"; + this.clSourceColumn.HeaderText = "來源欄位"; + this.clSourceColumn.Name = "clSourceColumn"; + this.clSourceColumn.ReadOnly = true; + this.clSourceColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.clSourceColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; + this.clSourceColumn.Width = 200; + // + // clTargetColumn + // + this.clTargetColumn.HeaderText = "目標欄位"; + this.clTargetColumn.Name = "clTargetColumn"; + this.clTargetColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.clTargetColumn.Width = 200; + // // txtWhere // this.txtWhere.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -434,45 +466,31 @@ namespace ExportDataToFile this.cbTargetTable.ValueMember = "TableName"; this.cbTargetTable.SelectedIndexChanged += new System.EventHandler(this.cbTargetTable_SelectedIndexChanged); // - // clExpColumn + // btnMapping // - this.clExpColumn.HeaderText = "匯出"; - this.clExpColumn.Name = "clExpColumn"; - this.clExpColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.clExpColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.clExpColumn.Width = 65; - // - // clClean - // - this.clClean.HeaderText = "清除"; - this.clClean.Name = "clClean"; - this.clClean.Width = 50; - // - // clSourceColumn - // - this.clSourceColumn.DataPropertyName = "COLUMN_NAME"; - this.clSourceColumn.HeaderText = "來源欄位"; - this.clSourceColumn.Name = "clSourceColumn"; - this.clSourceColumn.ReadOnly = true; - this.clSourceColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.clSourceColumn.Width = 200; - // - // clTargetColumn - // - this.clTargetColumn.HeaderText = "目標欄位"; - this.clTargetColumn.Name = "clTargetColumn"; - this.clTargetColumn.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.clTargetColumn.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.clTargetColumn.Width = 200; + this.btnMapping.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnMapping.Location = new System.Drawing.Point(1697, 528); + this.btnMapping.Name = "btnMapping"; + this.btnMapping.Size = new System.Drawing.Size(87, 33); + this.btnMapping.TabIndex = 50; + this.btnMapping.Text = "欄位對應"; + this.btnMapping.UseVisualStyleBackColor = true; + this.btnMapping.Click += new System.EventHandler(this.btnMapping_Click); // // clExport // + this.clExport.FalseValue = "false"; + this.clExport.Frozen = true; this.clExport.HeaderText = "匯出"; + this.clExport.IndeterminateValue = "false"; this.clExport.Name = "clExport"; + this.clExport.ReadOnly = true; + this.clExport.TrueValue = "true"; this.clExport.Width = 55; // // clCancel // + this.clCancel.Frozen = true; this.clCancel.HeaderText = "清除"; this.clCancel.Name = "clCancel"; this.clCancel.Text = "Clean"; @@ -481,12 +499,13 @@ namespace ExportDataToFile // clSourceTable // this.clSourceTable.DataPropertyName = "TableName"; + this.clSourceTable.Frozen = true; this.clSourceTable.HeaderText = "來源資料表名稱"; this.clSourceTable.Name = "clSourceTable"; this.clSourceTable.ReadOnly = true; this.clSourceTable.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.clSourceTable.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.clSourceTable.Width = 200; + this.clSourceTable.Width = 250; // // clTargetTable // @@ -495,7 +514,7 @@ namespace ExportDataToFile this.clTargetTable.ReadOnly = true; this.clTargetTable.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.clTargetTable.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - this.clTargetTable.Width = 130; + this.clTargetTable.Width = 250; // // clTableDel // @@ -532,6 +551,7 @@ namespace ExportDataToFile this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.SystemColors.ControlDarkDark; this.ClientSize = new System.Drawing.Size(1796, 1061); + this.Controls.Add(this.btnMapping); this.Controls.Add(this.cbTargetTable); this.Controls.Add(this.label14); this.Controls.Add(this.txtWhere); @@ -570,6 +590,7 @@ namespace ExportDataToFile this.Name = "Form1"; this.Text = "資料匯出程式"; this.WindowState = System.Windows.Forms.FormWindowState.Maximized; + this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing); ((System.ComponentModel.ISupportInitialize)(this.dgvExportList)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvColumnMapping)).EndInit(); this.ResumeLayout(false); @@ -614,6 +635,7 @@ namespace ExportDataToFile private System.Windows.Forms.DataGridViewButtonColumn clClean; private System.Windows.Forms.DataGridViewTextBoxColumn clSourceColumn; private System.Windows.Forms.DataGridViewComboBoxColumn clTargetColumn; + private System.Windows.Forms.Button btnMapping; private System.Windows.Forms.DataGridViewCheckBoxColumn clExport; private System.Windows.Forms.DataGridViewButtonColumn clCancel; private System.Windows.Forms.DataGridViewTextBoxColumn clSourceTable; diff --git a/Form1.cs b/Form1.cs index 722cecc..16ab941 100644 --- a/Form1.cs +++ b/Form1.cs @@ -141,29 +141,8 @@ namespace ExportDataToFile private void dgvExportList_CellClick(object sender, DataGridViewCellEventArgs e) { try - { - if (e.RowIndex != -1) - { - intExportIndex = e.RowIndex; - if (dgvExportList.Rows[e.RowIndex].Cells["clTargetTable"].Value != null) - { - cbTargetTable.SelectedValue = dgvExportList.Rows[e.RowIndex].Cells["clTargetTable"].Value; - } - else - { - cbTargetTable.SelectedValue = dgvExportList.Rows[e.RowIndex].Cells["clSourceTable"].Value; - } - if (cbTargetTable.SelectedValue != null) - { - ShowMSSQLSourceColumnList(sqlSourceConn, cbTargetTable.SelectedValue.ToString()); - } - - //預設所有欄位均匯出 - foreach (DataGridViewRow dgRow in dgvColumnMapping.Rows) - { - dgRow.Cells["clExpColumn"].Value = true; - } - } + { + LocatedTarget(e.RowIndex); } catch (Exception ex) { @@ -174,18 +153,16 @@ namespace ExportDataToFile private void dgvExportList_CellContentClick(object sender, DataGridViewCellEventArgs e) { try - { + { var senderGrid = (DataGridView)sender; - if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) + + if (e.RowIndex >= 0) { - senderGrid.Rows[e.RowIndex].Cells["clExport"].Value = false; - senderGrid.Rows[e.RowIndex].Cells["clTargetTable"].Value = ""; - senderGrid.Rows[e.RowIndex].Cells["clTableDel"].Value = false; - senderGrid.Rows[e.RowIndex].Cells["clDataTrim"].Value = false; - senderGrid.Rows[e.RowIndex].Cells["clMaxRecord"].Value = ""; - senderGrid.Rows[e.RowIndex].Cells["clWhere"].Value = ""; - senderGrid.Rows[e.RowIndex].Cells["clMappingData"].Value = ""; - txtWhere.Text = ""; + //清除該列資料 + if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn) + { + CleanExpRow(dgvExportList, e.RowIndex); + } } } catch (Exception ex) @@ -242,11 +219,11 @@ namespace ExportDataToFile try { var senderGrid = (DataGridView)sender; + //觸發清除事件 if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { senderGrid.Rows[e.RowIndex].Cells["clExpColumn"].Value = false; - ((DataGridViewComboBoxCell)senderGrid.Rows[e.RowIndex].Cells["clTargetColumn"]).Value = null; - txtWhere.Text = ""; + ((DataGridViewComboBoxCell)senderGrid.Rows[e.RowIndex].Cells["clTargetColumn"]).Value = null; } } catch (Exception ex) @@ -259,10 +236,12 @@ namespace ExportDataToFile { try { - dgvColumnMapping.Rows[e.RowIndex].Cells["clExpColumn"].Value = true; - dgvExportList.Rows[intExportIndex].Cells["clExport"].Value = true; - //設定來源與目標的資料表對應 - dgvExportList.Rows[intExportIndex].Cells["clTargetTable"].Value = cbTargetTable.SelectedValue.ToString(); + if (cbTargetTable.Enabled) + { + //dgvColumnMapping.Rows[e.RowIndex].Cells["clExpColumn"].Value = true; + //dgvExportList.Rows[intExportIndex].Cells["clExport"].Value = true; + + } } catch (Exception ex) { @@ -280,8 +259,84 @@ namespace ExportDataToFile } } + private void Form1_FormClosing(object sender, FormClosingEventArgs e) + { + sqlSourceConn.Close(); + sqlSourceConn = null; + sqlTargetConn.Close(); + sqlTargetConn = null; + } + + private void btnMapping_Click(object sender, EventArgs e) + { + //自動預設產生所有的Mapping檔案 + dgvExportList.Rows[intExportIndex].Cells["clMappingData"].Value = GenMappingColumn(); + dgvExportList.Rows[intExportIndex].Cells["clExport"].Value = true; + //設定來源與目標的資料表對應 + if (cbTargetTable.SelectedValue != null) + { + dgvExportList.Rows[intExportIndex].Cells["clTargetTable"].Value = cbTargetTable.SelectedValue.ToString(); + } + } + #region 自定義功能 + #region MS-SQL + private void ShowMSSQLSourceTables(SqlConnection sqlConn) + { + try + { + string strGetMSSQLTableList = "Select [name] as TableName from sys.tables order by name"; + dgvExportList.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLTableList, sqlConn).Tables["Result"]; + } + catch (Exception ex) + { + ErrorHandler.WriteErrorLog("Form1.cs", ex); + } + } + + private void ShowMSSQLTargetTableList(SqlConnection sqlConn) + { + try + { + string strGetMSSQLTableList = "Select [name] as TableName from sys.tables order by name"; + cbTargetTable.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLTableList, sqlConn).Tables["Result"]; + } + catch (Exception ex) + { + ErrorHandler.WriteErrorLog("Form1.cs", ex); + } + } + + private void ShowMSSQLSourceColumnList(SqlConnection sqlConn, string strTableName) + { + try + { + string strGetMSSQLColumnList = "Select COLUMN_NAME From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME ='" + strTableName + "' Order by ORDINAL_POSITION"; + dgvColumnMapping.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLColumnList, sqlConn).Tables["Result"]; + } + catch (Exception ex) + { + ErrorHandler.WriteErrorLog("Form1.cs", ex); + } + } + private void ShowMSSQLTargetColumnList(SqlConnection sqlConn, string strTableName) + { + try + { + string strGetMSSQLColumnList = "Select COLUMN_NAME From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME ='" + strTableName + "' Order by ORDINAL_POSITION"; + this.clTargetColumn.DisplayMember = "COLUMN_NAME"; + this.clTargetColumn.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLColumnList, sqlConn).Tables["Result"]; + Application.DoEvents(); + } + catch (Exception ex) + { + ErrorHandler.WriteErrorLog("Form1.cs", ex); + } + } + + #endregion //End of MS-SQL + private string CheckSource() { try @@ -435,64 +490,157 @@ namespace ExportDataToFile ErrorHandler.WriteErrorLog("Form1.cs", ex); } } - - #region MS-SQL - private void ShowMSSQLSourceTables(SqlConnection sqlConn) + + private string GenMappingColumn() { - try - { - string strGetMSSQLTableList = "Select [name] as TableName from sys.tables order by name"; - dgvExportList.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLTableList, sqlConn).Tables["Result"]; - } - catch (Exception ex) - { - ErrorHandler.WriteErrorLog("Form1.cs", ex); - } - } + string strExportColumns = ""; + string strSourceColumn = ""; + string strTargetColumn = ""; - private void ShowMSSQLTargetTableList(SqlConnection sqlConn) - { - try + //預設所有欄位均匯出 + foreach (DataGridViewRow dgRow in dgvColumnMapping.Rows) { - string strGetMSSQLTableList = "Select [name] as TableName from sys.tables order by name"; - cbTargetTable.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLTableList, sqlConn).Tables["Result"]; - } - catch (Exception ex) - { - ErrorHandler.WriteErrorLog("Form1.cs", ex); + //處理下拉欄位空白的問題 + if (dgRow.Cells["clExpColumn"].Value != null) + { + if ((bool)dgRow.Cells["clExpColumn"].Value == true) + { + if (dgRow.Cells["clSourceColumn"].Value == null) + { + strSourceColumn = " "; + } + else + { + strSourceColumn = dgRow.Cells["clSourceColumn"].Value.ToString(); + } + + if (dgRow.Cells["clTargetColumn"].Value == null) + { + strTargetColumn = " "; + } + else + { + strTargetColumn = dgRow.Cells["clTargetColumn"].Value.ToString(); + } + + if (strExportColumns == "") + { + + strExportColumns += strSourceColumn + "," + strTargetColumn; + } + else + { + strExportColumns += "|" + strSourceColumn + "," + strTargetColumn; + } + } + } } + + return strExportColumns; } - private void ShowMSSQLSourceColumnList(SqlConnection sqlConn, string strTableName) + private void LocatedTarget(int intRowIndex) { - try - { - string strGetMSSQLColumnList = "Select COLUMN_NAME From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME ='" + strTableName + "' Order by ORDINAL_POSITION"; - dgvColumnMapping.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLColumnList, sqlConn).Tables["Result"]; - } - catch (Exception ex) + if (cbTargetClass.SelectedIndex >= 0 && cbTargetClass.Enabled == false) { - ErrorHandler.WriteErrorLog("Form1.cs", ex); + //cbTargetTable.SelectedValue = dgvExportList.Rows[intRowIndex].Cells["clSourceTable"].Value.ToString(); + + string strTarget = ""; + string[] strColumnMapping = null; + + if (intRowIndex != -1) + { + intExportIndex = intRowIndex; + + //設定目標Table下拉式選單的內容 + if (dgvExportList.Rows[intRowIndex].Cells["clTargetTable"].Value != null && dgvExportList.Rows[intRowIndex].Cells["clTargetTable"].Value.ToString() != "") + { + strTarget = dgvExportList.Rows[intRowIndex].Cells["clTargetTable"].Value.ToString(); + } + else + { + strTarget = dgvExportList.Rows[intRowIndex].Cells["clSourceTable"].Value.ToString(); + } + + cbTargetTable.SelectedValue = strTarget; + + //取得欄位對應字串陣列 + if (dgvExportList.Rows[intRowIndex].Cells["clMappingData"].Value != null) + { + strColumnMapping = dgvExportList.Rows[intRowIndex].Cells["clMappingData"].Value.ToString().Split('|'); + } + + + //顯示欄位對應表的內容 + if (cbTargetTable.SelectedValue != null) + { + switch (cbTargetClass.SelectedItem.ToString().Trim()) + { + case "MS-SQL": + ShowMSSQLSourceColumnList(sqlSourceConn, strTarget.ToString()); + Application.DoEvents(); + break; + case "MySQL": + + break; + case "Oracle": + + break; + case "PostgreSQL": + + break; + } + } + + if (strColumnMapping != null) + { + string strSourceColumn = ""; + string strTargetColumn = ""; + foreach (string strColumn in strColumnMapping) + { + strSourceColumn = strColumn.Substring(0, strColumn.IndexOf(',')).Trim(); + strTargetColumn = strColumn.Substring(strColumn.IndexOf(',') + 1).Trim(); + foreach (DataGridViewRow dgvRow in dgvColumnMapping.Rows) + { + if (dgvRow.Cells["clSourceColumn"].Value.ToString() == strSourceColumn) + { + dgvRow.Cells[0].Value = true; + } + } + } + } + else + { + //預設所有欄位均匯出 + foreach (DataGridViewRow dgRow in dgvColumnMapping.Rows) + { + ((DataGridViewCheckBoxCell)dgRow.Cells["clExpColumn"]).Value = true; + } + } + } } } - private void ShowMSSQLTargetColumnList(SqlConnection sqlConn, string strTableName) + + private void CleanExpRow(DataGridView senderGrid, int intRowIndex) { - try - { - string strGetMSSQLColumnList = "Select COLUMN_NAME From INFORMATION_SCHEMA.COLUMNS Where TABLE_NAME ='" + strTableName + "' Order by ORDINAL_POSITION"; - this.clTargetColumn.DisplayMember = "COLUMN_NAME"; - this.clTargetColumn.DataSource = MSSQLUtility.GetSQLResult(strGetMSSQLColumnList, sqlConn).Tables["Result"]; - Application.DoEvents(); - } - catch (Exception ex) - { - ErrorHandler.WriteErrorLog("Form1.cs", ex); - } + senderGrid.Rows[intRowIndex].Cells["clExport"].Value = false; + senderGrid.Rows[intRowIndex].Cells["clTargetTable"].Value = ""; + senderGrid.Rows[intRowIndex].Cells["clTableDel"].Value = false; + senderGrid.Rows[intRowIndex].Cells["clDataTrim"].Value = false; + senderGrid.Rows[intRowIndex].Cells["clMaxRecord"].Value = ""; + senderGrid.Rows[intRowIndex].Cells["clWhere"].Value = ""; + senderGrid.Rows[intRowIndex].Cells["clMappingData"].Value = ""; + CleanMappingRow(senderGrid, intRowIndex); + txtWhere.Text = ""; + Application.DoEvents(); } - - #endregion - + private void CleanMappingRow(DataGridView senderGrid,int intRowIndex) + { + DataTable CleanTable = (DataTable)dgvColumnMapping.DataSource; + CleanTable.Rows.Clear(); + dgvColumnMapping.DataSource = CleanTable; + } #endregion diff --git a/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache b/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache index 8ef9cad680c5b7093c7dfc4ad164bf6a49c32ea6..811fdaf3a4643e9be3f31bebe872477f6035a5a9 100644 GIT binary patch delta 210 zcmeyjoN?L;#tjE}7^5an6chLK%}g%JFV0UZQ3%T{E=|l)2rem2$;^*2GBC7^am_19 zEh;F=EKZGa&d<%w&ohtlba9O-NKDR7OiwM=OU}mJVqjoM2bpF}hG~?CFkd*Wu~)9F)%R114W!C=kO{r`hr-SZ}Qr@0RV~D B4($K{ diff --git a/obj/Debug/ExportDataToFile.csproj.GenerateResource.cache b/obj/Debug/ExportDataToFile.csproj.GenerateResource.cache index 268db793da94f2c05a35b76b80730d61a876929d..b4ebde79f620786c1649d5b4d19fab3ae9a898f0 100644 GIT binary patch delta 25 hcmZ3-v5sRyD-&bR<~F8gMz#h02aK(cPv&Ql2LN{s2)_UT delta 25 hcmZ3-v5sRyD-)yN<~F8gMmFht1|5xuCiAn%0|0UY2yp-a