技术比较菜,希望大神们,帮帮忙!!多谢多谢!!!现在有表:biao1,biao2,biao3biao1至biao9都有liushuihao这个字段biao1至biao9包含很多条数据根据liushuihao 把biao1里面所有jine的和,加biao2里面所有jine的和,加biao3里面所有feiyong的和算出总计后在复制给string
解决方案 »
- 急:如何在单击一个按钮后会在该按钮下显示一个窗体数据供用户选择
- 如何替换 路径中的文件名称
- 关于form上datagrid事件的问题.高手请进
- 现有几个C#类,求高人做成DLL或COM组件给VC++或DELPHI调用(200分)急!!!!!!在线等
- 刚做了个SqlServer数据字典生成工具,大家给点意见哈
- 帮我看看是什么问题造成的错误!
- 求助问题:未能创建默认证书。正在中止发布。
- SystemInformation.DragSize,这个是干什么用的,为什么总是返回相同的值(4,4)?
- 如何改网页文件名?
- 有使用过codeproject上的c#做的outlook控件的帮帮忙
- C# 4.0的一些新特性
- C#中Udp通信问题
select jine as a from biao1 where liushuihao='' and isnumeric(jine)
union all
select jine as a from biao2 where liushuihao='' and isnumeric(jine)
union all
select feiyong as a from biao3 where liushuihao=' ' and isnumeric(feiyong)
) t
select jine as a from biao1 where liushuihao='' and isnumeric(jine)
union all
select jine as a from biao2 where liushuihao='' and isnumeric(jine)
union all
select feiyong as a from biao3 where liushuihao=' ' and isnumeric(feiyong)
) t
string strSQL = "select sum(t1.jine)+sum(t2.jine)+sum(t3.feiyong) as total from
biao1 t1,biao2 t2,biao3 t3
where t1.liushuihao =t2.liushuihao and t1.liushuihao = t3.liushuihao and t2.liushuihao =t3.liushuihao";
int ret = 0;using(SqlConnection con = new SqlConnection("Data Source=.;uid=sa;pwd=sa;Database=xxx"))
{
con.Open();
using(SqlCommand cmd = new SqlCommand(strSQL,con))
{
ret = (int)cmd.ExecuteScalar();
}
}
string s = "总金额为:"+ret.ToString();