Avatar billede pellesorensen Nybegynder
26. maj 2014 - 22:56 Der er 1 kommentar

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!
26. maj 2014 - 23:27 #1
Køre MySQL serveren på samme maskine som web serveren?

Hvis ikke, kan du så pinge database serveren fra web serveren?


Husk at skifte kode da du lige har afsløret den.
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Computerworld tilbyder specialiserede kurser i database-management

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester