易截截图软件、单文件、免安装、纯绿色、仅160KB

为什么访问不了SQL数据库 - .NET技术 / C#

public static DataSet ExecuteDataSet(string StrSql)
  {
  SqlConnection strcon = new SqlConnection(con());
  try
  {
  SqlCommand cmd = new SqlCommand(StrSql, strcon);
  cmd.CommandTimeout = 180;
  cmd.CommandText = StrSql;
  cmd.CommandType = CommandType.Text;
  SqlDataAdapter sda = new SqlDataAdapter();
  sda.SelectCommand = cmd;
  DataSet ds = new DataSet();
  sda.Fill(ds);
  sda.Dispose();
  return ds;
  }
  catch  
  {

  if (strcon.State == ConnectionState.Open)
  strcon.Close();
  strcon.Dispose();
  return null;
  }
  finally
  {
  strcon.Dispose();
  if (strcon.State == ConnectionState.Open)
  strcon.Close();
  }
  }

登录的时候 查询 用户名和密码  
  sb.Append(" Select * from Table_d Where [LoginUser]='" + _LoginUser + "' and [LoginPwd]='" + _LoginPwd + "'");

  DataSet _Login_Ds = DbHelper.ExecuteDataSet(sb.ToString());
  if (_Login_Ds != null)
  {
  DataTable _Login_Dt = _Login_Ds.Tables[0];
  if (_Login_Dt.Rows.Count > 0)
  {
Session["Department"] = _Login_Dt.Rows[0]["Department"].ToStri


相关问答:

csv文件转换成sql导入到数据库,没有数据为何?

执行的顺序:
1)文件浏览框(选择文件使用)
选择好文件后
点击一个导入按钮的时候 ,把上面上传框里的csv文件以一个ID为文件名,上传到**/**文件夹下
2)读取这个文件夹下的csv的文件,转换成sql
3 ......

求一sql语句 - MS-SQL Server / 疑难问题

现在有两张表:文章主表A(articleId,articleTitle),文章评论表B(commentId,articleId,commentTitle)
现在我想实现这样的功能:列出文章列表,其中每篇文章标题下面列出此文章的前2个文章评论,请问sql语句怎么写啊 ......

求一SQL - MS-SQL Server / 基础类

tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......

请教SQL语句查询问题? - MS-SQL Server / 基础类

我想查询出每天数据的最大的一个值。表的格式如下
表名: hisdata
字段 编号 值 状态 时间  
  Id value state dattime  
  101 32.3 0 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号