string excelFileName = StartConstructionPlanFacade.GetExcelFirstTableName(filePath);
GetConnectionObject.InitConnectionObject("Excel");
cn = GetConnectionObject.ExceoConnectionObject;
string sql = "select distinct [单价分析综合表] from [" + excelFileName + "] where [单价分析综合表] is not null"
+ " and F2 not in ('人工','材料','机械',null) and F3 is null";
OdbcCommand cmd = cn.CreateCommand();
cmd.CommandText = sql;
da = new OdbcDataAdapter(cmd);
cn.Open();
da.Fill(ds, "quotaIDTable");
data = ds.Tables["quotaIDTable"];
int k = 0;
while (new BudgetQuotaQuery().GetBudgetQuotaInfo
(ds.Tables["quotaIDTable"].Rows[k]["单价分析综合表"].ToString()).Rows.Count == 1
¦ ¦ k < ds.Tables["quotaIDTable"].Rows.Count - 1)
{
for (int i = 0; i < ds.Tables["quotaIDTable"].Rows.Count; i++)
{
if (new BudgetQuotaQuery().GetBudgetQuotaInfo
(ds.Tables["quotaIDTable"].Rows[i]["单价分析综合表"].ToString()).Rows.Count == 1)
{
ds.Tables["quotaIDTable"].Rows.RemoveAt(i);
}
}
k++;
}
}
catch (Exception er)
{
throw er;
}
finally
{
GetConnectionObject.CloseExcelConnectionObject(cn);
}
return ds;运行到da.Fill(ds, "quotaIDTable"); 出错
GetConnectionObject.InitConnectionObject("Excel");
cn = GetConnectionObject.ExceoConnectionObject;
string sql = "select distinct [单价分析综合表] from [" + excelFileName + "] where [单价分析综合表] is not null"
+ " and F2 not in ('人工','材料','机械',null) and F3 is null";
OdbcCommand cmd = cn.CreateCommand();
cmd.CommandText = sql;
da = new OdbcDataAdapter(cmd);
cn.Open();
da.Fill(ds, "quotaIDTable");
data = ds.Tables["quotaIDTable"];
int k = 0;
while (new BudgetQuotaQuery().GetBudgetQuotaInfo
(ds.Tables["quotaIDTable"].Rows[k]["单价分析综合表"].ToString()).Rows.Count == 1
¦ ¦ k < ds.Tables["quotaIDTable"].Rows.Count - 1)
{
for (int i = 0; i < ds.Tables["quotaIDTable"].Rows.Count; i++)
{
if (new BudgetQuotaQuery().GetBudgetQuotaInfo
(ds.Tables["quotaIDTable"].Rows[i]["单价分析综合表"].ToString()).Rows.Count == 1)
{
ds.Tables["quotaIDTable"].Rows.RemoveAt(i);
}
}
k++;
}
}
catch (Exception er)
{
throw er;
}
finally
{
GetConnectionObject.CloseExcelConnectionObject(cn);
}
return ds;运行到da.Fill(ds, "quotaIDTable"); 出错
解决方案 »
- 【急】C#如何实现SQL连接显示所有的数据库?
- C#WinForm中DAL层使用【存储过程】
- updatepanel更新全部页面
- .net系统怎么设置长时间不操作重新登录的功能
- 菜鸟问问题,分多问题菜
- 指定的路径不可用,IIS可能并未运行或者是路径已经重定向到另外的计算机。请检查internet servers manager 中虚拟目录的状态。
- 求救`_完成一个复数类、提供复数的加减运算(也可以完成乘除运算),并重写ToString方法。
- 如何修改光标作用点阿?
- GetChildRows得到的数据能不能用datagrid控件显示?
- 300分寻找《ASP.NET技术内幕》电子书
- microsoft visual studio2005中使用datagridview直接更新数据,怎么办?
- DataTable.Select()怎么不支持与运算啊?
+ " and F2 not in ('人工','材料','机械',null) and F3 is null就他了 上面有 谢谢
and F2 not isnull and f2 not in ('人工','材料','机械') and F3 is null
否则会查询不到记录