c# access sql where

来源:互联网 发布:微信支付开发案例java 编辑:程序博客网 时间:2024/06/01 07:44

写一个表格查询,估计是表格名称是使用了关键字,查询总是出错,最后是更改表格名称顺利实现

 

当然这个过程走了些弯路,去查询所有表格名称,代码如下

http://blog.csdn.net/ffei060828/article/details/29933123

        //读取access数据库所有表格名称
//        DataTable shemaTable = oledbcon.GetOleDbSchemaTable(OleDbSchemaGuid.Tables,

//new object[] { null, null, null, "TABLE" });

//        int n = shemaTable.Rows.Count;
//        string[] strTable = new string[n];
//        int m = shemaTable.Columns.IndexOf("TABLE_NAME");
//        for (int i = 0; i < n; i++)
//        {
//            DataRow m_DataRow = shemaTable.Rows[i];
//            strTable[i] = m_DataRow.ItemArray.GetValue(m).ToString();

//            Response.Write(strTable[i]+"   ");
//        }

 

0 0