L
Lasse Edsvik
Hello
Anyone know why i get:
Exception Details: System.ArgumentException: Format of the initialization
string does not conform to specification starting at index 0.
Line 14: OleDbConnection conn = new OleDbConnection("ConnectionString");
Web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="Data Source=127.0.0.1,1433;Network
Library=DBMSSOCN;Initial Catalog=northwind;User ID=sa;Password="/>
</appSettings>
<system.web>
</system.web>
</configuration>
code:
using System;
using System.Data;
using System.Data.OleDb;
namespace dbtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
OleDbConnection conn = new OleDbConnection("ConnectionString");
OleDbCommand cmd = new OleDbCommand("SalesByCategory",conn);
cmd.CommandType = CommandType.StoredProcedure;
// do stuff
conn.Close();
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}
Anyone know why i get:
Exception Details: System.ArgumentException: Format of the initialization
string does not conform to specification starting at index 0.
Line 14: OleDbConnection conn = new OleDbConnection("ConnectionString");
Web.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="ConnectionString" value="Data Source=127.0.0.1,1433;Network
Library=DBMSSOCN;Initial Catalog=northwind;User ID=sa;Password="/>
</appSettings>
<system.web>
</system.web>
</configuration>
code:
using System;
using System.Data;
using System.Data.OleDb;
namespace dbtest
{
/// <summary>
/// Summary description for WebForm1.
/// </summary>
public class WebForm1 : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
OleDbConnection conn = new OleDbConnection("ConnectionString");
OleDbCommand cmd = new OleDbCommand("SalesByCategory",conn);
cmd.CommandType = CommandType.StoredProcedure;
// do stuff
conn.Close();
// Put user code to initialize the page here
}
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);
}
#endregion
}
}