-
大小: 2.95MB文件類型: .zip金幣: 2下載: 1 次發(fā)布日期: 2023-10-30
- 語言: 數(shù)據(jù)庫
- 標簽: datagridview??
資源簡介
一個彈出窗口,用戶可以自定義檢索條件,通過檢索條件來修改datagridview
關(guān)聯(lián)的dataadapter的selectcommand,來達到過濾數(shù)據(jù)目的,目前較成功,
歡迎各位修改,更加完善
目前使用 sqlserver測試,單表,多表,含有下拉列表的都可以,歡迎大家修改后上傳,做成一個通用組合查詢的dll,更完美就好了

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
using?CommonQueryClassLib;
namespace?CommonQueryTest1
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????//?TODO:?這行代碼將數(shù)據(jù)加載到表“mySchoolDataSet.DataTable1”中。您可以根據(jù)需要移動或刪除它。
????????????this.dataTable1TableAdapter.Fill(this.mySchoolDataSet.DataTable1);
???????????
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
?????????????string?oldSqlTextCommandString;
????????????SqlTextStringClass?sqlTextStringClass?=?new?SqlTextStringClass();
????????????sqlTextStringClass.SelectedCommandText?=?dataTable1TableAdapter.Adapter.SelectCommand.CommandText.ToString();
????????????oldSqlTextCommandString?=?dataTable1TableAdapter.Adapter.SelectCommand.CommandText.ToString();
????????????//MessageBox.Show(oldSqlTextCommandString);
????????????
????????????popoupWindow?pw?=?new?popoupWindow(dataGridView1?ref?sqlTextStringClass);
????????????pw.ShowDialog();
????????????try
????????????{
????????????????MessageBox.Show(sqlTextStringClass.SelectedCommandText);
????????????????dataTable1TableAdapter.Adapter.SelectCommand.CommandText?=?sqlTextStringClass.SelectedCommandText;
????????????????this.dataTable1TableAdapter.Fill(this.mySchoolDataSet.DataTable1);
????????????}
????????????catch?(Exception?ex)
????????????{
????????????????MessageBox.Show(ex.ToString());
????????????}
????????????finally
????????????{
????????????????this.dataTable1TableAdapter.Fill(this.mySchoolDataSet.DataTable1);
????????????}
????????}
????????}
????}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2012-08-01?16:15??通用組合查詢成功\
?????目錄???????????0??2012-08-01?15:59??通用組合查詢成功\使用Dll查詢\
?????目錄???????????0??2012-08-01?15:59??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\
?????文件?????????890??2012-08-01?15:16??通用組合查詢成功\使用Dll查詢\CommonQueryTest1.sln
?????文件???????19968??2012-08-01?16:15??通用組合查詢成功\使用Dll查詢\CommonQueryTest1.suo
?????文件?????????507??2012-08-01?15:19??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\app.config
?????目錄???????????0??2012-08-01?15:59??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\
?????目錄???????????0??2012-08-01?16:12??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\
?????文件???????52736??2012-08-01?16:11??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryClassLib.dll
?????文件??????101888??2012-08-01?16:11??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryClassLib.pdb
?????文件???????72192??2012-08-01?16:12??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryTest1.exe
?????文件?????????507??2012-08-01?15:19??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryTest1.exe.config
?????文件??????153088??2012-08-01?16:12??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryTest1.pdb
?????文件???????11600??2012-08-01?16:15??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryTest1.vshost.exe
?????文件?????????507??2012-08-01?15:19??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryTest1.vshost.exe.config
?????文件?????????490??2009-08-31?00:40??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Debug\CommonQueryTest1.vshost.exe.manifest
?????目錄???????????0??2012-08-01?15:19??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\bin\Release\
?????文件????????4525??2012-08-01?15:23??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\CommonQueryTest1.csproj
?????文件????????1924??2012-08-01?15:53??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\Form1.cs
?????文件???????10693??2012-08-01?15:36??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\Form1.Designer.cs
?????文件????????6443??2012-08-01?15:36??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\Form1.resx
?????文件??????199595??2012-08-01?15:25??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\MySchoolDataSet.Designer.cs
?????文件?????????361??2012-08-01?15:25??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\MySchoolDataSet.xsc
?????文件???????34402??2012-08-01?15:25??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\MySchoolDataSet.xsd
?????文件????????1909??2012-08-01?15:25??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\MySchoolDataSet.xss
?????目錄???????????0??2012-08-01?15:59??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\obj\
?????目錄???????????0??2012-08-01?15:59??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\obj\x86\
?????目錄???????????0??2012-08-01?16:12??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\obj\x86\Debug\
?????文件????????2508??2012-08-01?16:15??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\obj\x86\Debug\CommonQueryTest1.csproj.FileListAbsolute.txt
?????文件???????72192??2012-08-01?16:12??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\obj\x86\Debug\CommonQueryTest1.exe
?????文件?????????180??2012-08-01?16:12??通用組合查詢成功\使用Dll查詢\CommonQueryTest1\obj\x86\Debug\CommonQueryTest1.Form1.resources
............此處省略298個文件信息
評論
共有 條評論