22,210
社区成员
发帖
与我相关
我的任务
分享
string queryStringRgt = @"SELECT TB_YWDA.ywda_SeqNO as 顺序号, TB_YWDAJ.ywdaj_DirName as 档号, TB_YWDAJ.ywdaj_KeepPeriod as 保管期限, TB_YWDAJ.ywdaj_Year as 年度, "
+ " TB_YWDA.ywda_Responsible as 责任者, TB_YWDA.ywda_Title as 题名, TB_YWDA.ywda_PageNO as 页号, TB_YWDAJ.ywdaj_Type as 档案类别, "
+ " TB_YWDA.ywda_PageSum as 页数, TB_YWDA.ywda_CreatedTime as 成文时间, TB_YWDA.ywda_ID, TB_YWDA.ywdaj_ID FROM TB_YWDA left join TB_YWDAJ on TB_YWDA.ywdaj_ID = TB_YWDAJ.ywdaj_ID where CInt(TB_YWDA.ywdaj_ID) = '" + selectedYwdajID + "'";
OleDbCommand SQLQuery = new OleDbCommand();
DataTable data = new DataTable();
this.skinDataGridViewRgt.DataSource = null;
SQLQuery.Connection = null;
OleDbDataAdapter dataAdapter = null;
this.skinDataGridViewRgt.Columns.Clear(); // <-- clear columns
//---------------------------------
SQLQuery.CommandText = sqlQueryString;
SQLQuery.Connection = dataBase;
dataAdapter = new OleDbDataAdapter(SQLQuery);
MessageBox.Show("hah");
dataAdapter.Fill(data); //问题出在这一行
skinDataGridViewRgt.DataSource = data;
SELECT
TB_YWDA.ywda_SeqNO as 顺序号
, TB_YWDAJ.ywdaj_DirName as 档号
, TB_YWDAJ.ywdaj_KeepPeriod as 保管期限
, TB_YWDAJ.ywdaj_Year as 年度
, TB_YWDA.ywda_Responsible as 责任者
, TB_YWDA.ywda_Title as 题名
, TB_YWDA.ywda_PageNO as 页号
, TB_YWDAJ.ywdaj_Type as 档案类别
, TB_YWDA.ywda_PageSum as 页数
, TB_YWDA.ywda_CreatedTime as 成文时间
, TB_YWDA.ywda_ID
, TB_YWDA.ywdaj_ID
FROM TB_YWDA
left join TB_YWDAJ on TB_YWDA.ywdaj_ID = TB_YWDAJ.ywdaj_ID
where CInt(TB_YWDA.ywdaj_ID) = 'selectedYwdajID'
AND TB_YWDAJ.ywdaj_ID IS NULL