M
Mark Wilson
For some reason I am getting this error even though (as you can see from the
code in the Initialize Component procedure) the object reference has been
established... I am at my wit's end.. Thanks for any advice...
--------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public class x : System.Web.UI.Page
{
protected System.Data.SqlClient.SqlConnection sqlConnection1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
sqlConnection1.Open(); <-- Error occurs on this line
}
private void InitializeComponent()
{
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "packet size=4096;user id=XXX;data
source=XXX;persist security info=False;initial catalog=XXX;password=XXX";
this.Load += new System.EventHandler(this.Page_Load);
}
code in the Initialize Component procedure) the object reference has been
established... I am at my wit's end.. Thanks for any advice...
--------------------
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using CrystalDecisions.CrystalReports.Engine;
using CrystalDecisions.Shared;
public class x : System.Web.UI.Page
{
protected System.Data.SqlClient.SqlConnection sqlConnection1;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
sqlConnection1.Open(); <-- Error occurs on this line
}
private void InitializeComponent()
{
this.sqlConnection1 = new System.Data.SqlClient.SqlConnection();
//
// sqlConnection1
//
this.sqlConnection1.ConnectionString = "packet size=4096;user id=XXX;data
source=XXX;persist security info=False;initial catalog=XXX;password=XXX";
this.Load += new System.EventHandler(this.Page_Load);
}