求教一个SQL语句的问题 - .NET技术 / ASP.NET
public partial class MasterPage : System.Web.UI.MasterPage
{
string sqlConnString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
protected void Page_Load(object sender, EventArgs e)
{
if (Session["Username"] == null)
Response.Redirect("admin.aspx");
string username = Session["Username"].ToString();
Label1.Text = Session["Username"].ToString();
Label2.Text = DateTime.Now.ToShortDateString();
if (!IsPostBack)
{
using (SqlConnection con = new SqlConnection(sqlConnString))
{
SqlCommand cmd = con.CreateCommand();
cmd.CommandText = "SELECT RoleID form admin where username='"+ username+"'";
con.Open();
SqlDataReader ds = cmd.ExecuteReader();
if (ds.Read())
{
HiddenField1.Value = ds["RoleID"].ToString();
}
ds.Close();
con.Close();
}
}
&n
相关问答:
本人工作经验一年以上
熟悉asp.net
熟悉javascript
熟悉Css
熟悉ajax
熟悉sqlserver2005
有一年的项目经验
具体项目和其他的就不在这写了
有意者联系:
QQ:359233910
引用
本人工作经验一年以上
熟悉asp ......
tab1 字段:billdate,goodsid,incount,inmoney,outcount,outmoney,endprice,endcount,endamt
tab2 字段:goodsid,goodskind(商品类型)
tab3 字段:goodskind(商品类型),kindname
结果:
得到商品类型在一段时间 ......
字段1,字段2.....字段N,Status,ParentID
1,Name1....test1,1,99
1,Name1....test1,3,99
1,Name2....test2,1,101
1,Name2....test2,3,101
1,Name3....test3,2,101
1,Name1....test1,4,101
想要的结果是:
1,Na ......
sqlserver的数据库,字段是image类型的。怎么写代码,在页面中点击“下载”就能打开那个下载对话框?
PS:OracleLob 在sqlserver里是什么?
Response.Redirect("test.jpg")
引用
Response.Redirect( ......
在Access的查询中执行下面的语句,无效,提示期待select ,updata ,...
CreateTble C=Answer N="回帖表"
(
C=ID T="INTEGER" P=No M=No N="编号" Z=false,
C=Ques ......