sqlserver帮助类的使用

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Common;
namespace WebApplication5
{
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{


SqlParameter[] paras = new SqlParameter[] {
new SqlParameter("@id",1)
};
DataSet dt = SQLHelper.ExcuteDataSet("select * from [orderinfo] where id=@id", paras);
}
}
}

 

web.config配置

<connectionStrings>
<!--<add name="connStr" connectionString="data source=127.0.0.1;uid=root;pwd=123456;database=wgh_school;Charset=utf8" />-->
<add name="connStr" connectionString="user id=sa;password=123456;initial catalog=fjlc.shopping;data source=LAPTOP-MD433D0P\WUGONGH" />
</connectionStrings>

sqlserver帮助类的使用

上一篇:MySQL ------ 数据类型(datatype)(三十一)


下一篇:Oracle语句(三)-- 字符函数