Friday, February 24, 2012

Exception (Unable to connect to SQL Server database).

hi... i am new to ASP2.0 and i was trying to use the properties associated with the profile class.

here what i was trying to do...

in"Web.config"

<

anonymousIdentificationenabled="true"/>

<profileenabled ="true">

<properties>

<addname="p1"allowAnonymous ="true"/>

</properties>

</profile>

in"Default.aspx.cs"

protected

void Page_Load(object sender,EventArgs e)

{

if (!Page.IsPostBack) {

Profile.p1 =

"Welcome";

LabelResult.Text = Profile.p1;

}

else{

Profile.p1 =

"you'v been here";

LabelResult.Text = Profile.p1;

}

}

but i had the exception ( Unable to connect to SQL Server database) at "App_Code.qzomymsu.0.cs"

public

virtualstring p1 {get { return ((string)(this.GetPropertyValue("p1")));

}

set { this.SetPropertyValue("p1",value);

}

}

i know the problem has something to do with providers, and i want to store the values to an XML file... thank you for helping.

What's the connection string you used to connect to SQL?

No comments:

Post a Comment