The network path was not found
Hvorfor får jeg denne mærkelige fejl?Server Error in '/1021853' Application.
The network path was not found
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.ComponentModel.Win32Exception: The network path was not found
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Her er min aspx.cs
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;
using System.Configuration;
namespace Eksamensprojekt
{
public partial class contact : System.Web.UI.Page
{
SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["mmdb0912_1ConnectionString"].ConnectionString);
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
}
protected void Button1_Click(object sender, EventArgs e)
{
SqlCommand cmd = new SqlCommand("insert into tbl values('"+txtnavn.Text+"','"+txtmail.Text+"','"+txtbesked.Text+"')",con);
cmd.ExecuteNonQuery();
con.Close();
Label1.Visible = true;
Label1.Text = "Your data stored";
txtnavn.Text = "";
txtmail.Text = "";
txtbesked.Text = "";
}
}
}
Og min web.config
<configuration>
<connectionStrings>
<add name="mmdb0912_1ConnectionString" connectionString="Data Source=balder.ucn.dk;Initial Catalog=mmdb0912_1;User ID=mmdb0912_1;Password=MaaGodt"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<customErrors mode="Off"></customErrors>
<compilation debug="true" targetFramework="4.0" />
</system.web>
</configuration>
HJÆLP!