ASP.NET '会员' 附近有语法错误 5
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSys...
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;using System.Data.SqlClient;public partial class _Default : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void btnCountNum_Click(object sender, EventArgs e) { string constr = "server=PC201508271657\\SQLEXPRESS;Initial Catalog=lalala;Integrated Security=True"; SqlConnection con = new SqlConnection(constr); SqlCommand cmd = new SqlCommand("select count(*) form 会员",con); con.Open(); int count = int.Parse(cmd.ExecuteScalar().ToString()); con.Close(); Response.Write("会员人数是:"+count); }}
展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询