日期:2014-05-18  浏览次数:20654 次

急救!!!
c:\inetpub\wwwroot\bycj\login.aspx.cs(56): 找不到类型或命名空间名称“Sqlconnection”(是否缺少 using 指令或程序集引用?)

我的名称空间中已经加了using System.Data.SqlClient;为什么还会出现上面的提示

------解决方案--------------------
private void btnlogin_Click(object sender, System.EventArgs e) 

SqlConnection con=new SqlConnection ("server=CHINESE-11E9574;uid=sa;pwd=;database=khgx"); 
con.Open(); 
SqlCommand com=new SqlCommand("select count(*) from user where LoginID='"+txtusername.Text+"'and password='"+txtpassword+"',con"); 
int count=Convert.ToInt32(com.ExecuteScalar().ToString()); 
if (count>0) 

Response.Redirect("default.aspx"); 

con.Close(); 

楼主你是直接哪里拷的代码吧!