我试图创建一个非常简单的社交网络系统。但是,我收到一个错误:
找不到网络路径
我知道它通常是连接字符串,我已经仔细检查过,但是找不到任何错误。
web.config文件:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="Connect" connectionString="Data Source=db555.db.1and1.com;Initial Catalog=db555;User ID=dbo555;Password=JJKSJUWJS$" />
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.5"/>
<httpRuntime targetFramework="4.5"/>
</system.web>
</configuration>
特定的错误控制台会突出显示以下内容:
protected void Page_Load(object sender, EventArgs e)
{
con.ConnectionString = ConfigurationManager.ConnectionStrings["Connect"].ConnectionString;
if (con.State == ConnectionState.Closed)
{
con.Open();
}
EmailId = Session["EmailId"].ToString();
da = new SqlDataAdapter("select UserId from Registration where EmailId='" + EmailId + "'", con);
da.Fill(ds);
if (ds.Tables[0].Rows.Count > 0)
{
UserId = ds.Tables[0].Rows[0]["UserId"].ToString();
}
Session["UId"] = UserId;
showPost();
}