I am not going to write a aspx to connect a SQL Server... but it tries to co
nnect the SQL Server...
Some of the Code..
protected void LoginButton_Click(object sender, EventArgs e)
{
if (Request.Form["txtServerName"] == null || Request.Form["txtServerName"] =
= "")
{
Session["Server_Name"] = "LocalHost";
}
else
{
Session["Server_Name"] = Request.Form["txtServerName"];
}
if (isValidUser((String)Session["Server_Name"], frmLogin.UserName,frmLogin.P
assword))
{
Session["Server_Username"] = frmLogin.UserName;
Session["Server_Password"] = frmLogin.Password;
FormsAuthentication.RedirectFromLoginPage(frmLogin.UserName, false);
Response.End();
}
else
{
//FailureText.Text = "Access Denied!";
//Response.End();
}
}
When isValid returns true, it is ok, and redirected to another page, but whe
n isValid return false, the error occrus then, the error message is:
An error has occurred while establishing a connection to the server. When c
onnecting to SQL Server 2005, this failure may be caused by the fact that un
der the default settings SQL Server does not allow remote connections. (prov
ider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Spe
cified)
Description: An unhandled exception occurred during the execution of the cur
rent web request. Please review the stack trace for more information about t
he error and where it originated in the code.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a
database location within the applications App_Data directory. The provider a
ttempted to automatically create the application services database because t
he provider determined that the database does not exist. The following confi
guration requirements are necessary to successfully check for existence of t
he application services database and automatically create the application se
rvices database:
1.. If the applications App_Data directory does not already exist, the web s
erver account must have read and write access to the applications directory.
This is necessary because the web server account will automatically create
the App_Data directory if it does not already exist.
2.. If the applications App_Data directory already exists, the web server ac
count only requires read and write access to the applications App_Data direc
tory. This is necessary because the web server account will attempt to verif
y that the Sql Server Express database already exists within the application
s App_Data directory. Revoking read access on the App_Data directory from th
e web server account will prevent the provider from correctly determining if
the Sql Server Express database already exists. This will cause an error wh
en the provider attempts to create a duplicate of an already existing databa
se. Write access is required because the web server accounts credentials are
used when creating the new database.
3.. Sql Server Express must be installed on the machine.
4.. The process identity for the web server account must have a local user p
rofile. See the readme document for details on how to create a local user pr
ofile for both machine and domain accounts.
However I did not install and not running the SQL Express Edition, I want to
know why the ASPX is connecting to the SQL Server but there is no code for
the SQL <-> ASP.NET Connections.
Thank you.It wouldn't actually be in this code, it would be the settings in your web.c
onfig. I've noticed that as a default, when there are problems with a member
ship setting the membership runtime will try to connect to a sql server expr
ess database, since this is the default installation type.
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199...2006
"LamSoft" <[nospam]lamsoft@.lamsoft.net> wrote in message news:%233Ck3IMrHHA.5032@.TK2
MSFTNGP02.phx.gbl...
I am not going to write a aspx to connect a SQL Server... but it tries to co
nnect the SQL Server...
Some of the Code..
protected void LoginButton_Click(object sender, EventArgs e)
{
if (Request.Form["txtServerName"] == null || Request.Form["txtServerName"] =
= "")
{
Session["Server_Name"] = "LocalHost";
}
else
{
Session["Server_Name"] = Request.Form["txtServerName"];
}
if (isValidUser((String)Session["Server_Name"], frmLogin.UserName,frmLogin.P
assword))
{
Session["Server_Username"] = frmLogin.UserName;
Session["Server_Password"] = frmLogin.Password;
FormsAuthentication.RedirectFromLoginPage(frmLogin.UserName, false);
Response.End();
}
else
{
//FailureText.Text = "Access Denied!";
//Response.End();
}
}
When isValid returns true, it is ok, and redirected to another page, but whe
n isValid return false, the error occrus then, the error message is:
An error has occurred while establishing a connection to the server. When c
onnecting to SQL Server 2005, this failure may be caused by the fact that un
der the default settings SQL Server does not allow remote connections. (prov
ider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Spe
cified)
Description: An unhandled exception occurred during the execution of the cur
rent web request. Please review the stack trace for more information about t
he error and where it originated in the code.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a
database location within the applications App_Data directory. The provider a
ttempted to automatically create the application services database because t
he provider determined that the database does not exist. The following confi
guration requirements are necessary to successfully check for existence of t
he application services database and automatically create the application se
rvices database:
1.. If the applications App_Data directory does not already exist, the web s
erver account must have read and write access to the applications directory.
This is necessary because the web server account will automatically create
the App_Data directory if it does not already exist.
2.. If the applications App_Data directory already exists, the web server ac
count only requires read and write access to the applications App_Data direc
tory. This is necessary because the web server account will attempt to verif
y that the Sql Server Express database already exists within the application
s App_Data directory. Revoking read access on the App_Data directory from th
e web server account will prevent the provider from correctly determining if
the Sql Server Express database already exists. This will cause an error wh
en the provider attempts to create a duplicate of an already existing databa
se. Write access is required because the web server accounts credentials are
used when creating the new database.
3.. Sql Server Express must be installed on the machine.
4.. The process identity for the web server account must have a local user p
rofile. See the readme document for details on how to create a local user pr
ofile for both machine and domain accounts.
However I did not install and not running the SQL Express Edition, I want to
know why the ASPX is connecting to the SQL Server but there is no code for
the SQL <-> ASP.NET Connections.
Thank you.
re:
!> An error has occurred while establishing a connection to the server.
!> When connecting to SQL Server 2005, this failure may be caused by the fac
t
!> that under the default settings SQL Server does not allow remote connecti
ons.
To fix that, please follow the instructions in this KB:
http://support.microsoft.com/kb/914277/en-us
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espanol : http://asp.net.do/foros/
======================================
"LamSoft" <[nospam]lamsoft@.lamsoft.net> wrote in message
news:%233Ck3IMrHHA.5032@.TK2MSFTNGP02.phx.gbl...
I am not going to write a aspx to connect a SQL Server... but it tries to co
nnect the SQL Server...
Some of the Code..
protected void LoginButton_Click(object sender, EventArgs e)
{
if (Request.Form["txtServerName"] == null || Request.Form["txtServerName"] =
= "")
{
Session["Server_Name"] = "LocalHost";
}
else
{
Session["Server_Name"] = Request.Form["txtServerName"];
}
if (isValidUser((String)Session["Server_Name"], frmLogin.UserName,frmLogin.P
assword))
{
Session["Server_Username"] = frmLogin.UserName;
Session["Server_Password"] = frmLogin.Password;
FormsAuthentication.RedirectFromLoginPage(frmLogin.UserName, false);
Response.End();
}
else
{
//FailureText.Text = "Access Denied!";
//Response.End();
}
}
When isValid returns true, it is ok, and redirected to another page, but whe
n isValid return false,
the error occrus then, the error message is:
An error has occurred while establishing a connection to the server. When c
onnecting to SQL Server
2005, this failure may be caused by the fact that under the default settings
SQL Server does not
allow remote connections. (provider: SQL Network Interfaces, error: 26 - Err
or Locating
Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the cur
rent web request.
Please review the stack trace for more information about the error and where
it originated in the
code.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a
database location within
the applications App_Data directory. The provider attempted to automatically
create the application
services database because the provider determined that the database does not
exist. The following
configuration requirements are necessary to successfully check for existence
of the application
services database and automatically create the application services database
:
1.. If the applications App_Data directory does not already exist, the web s
erver account must
have read and write access to the applications directory. This is necessary
because the web server
account will automatically create the App_Data directory if it does not alre
ady exist.
2.. If the applications App_Data directory already exists, the web server ac
count only requires
read and write access to the applications App_Data directory. This is necess
ary because the web
server account will attempt to verify that the Sql Server Express database a
lready exists within the
applications App_Data directory. Revoking read access on the App_Data direct
ory from the web server
account will prevent the provider from correctly determining if the Sql Serv
er Express database
already exists. This will cause an error when the provider attempts to creat
e a duplicate of an
already existing database. Write access is required because the web server a
ccounts credentials are
used when creating the new database.
3.. Sql Server Express must be installed on the machine.
4.. The process identity for the web server account must have a local user p
rofile. See the readme
document for details on how to create a local user profile for both machine
and domain accounts.
However I did not install and not running the SQL Express Edition, I want to
know why the ASPX is
connecting to the SQL Server but there is no code for the SQL <-> ASP.NET Co
nnections.
Thank you.
thank you very much.
"LamSoft" <[nospam]lamsoft@.lamsoft.net> wrote in message news:%233Ck3IMrHHA.5032@.TK2
MSFTNGP02.phx.gbl...
I am not going to write a aspx to connect a SQL Server... but it tries to co
nnect the SQL Server...
Some of the Code..
protected void LoginButton_Click(object sender, EventArgs e)
{
if (Request.Form["txtServerName"] == null || Request.Form["txtServerName"] =
= "")
{
Session["Server_Name"] = "LocalHost";
}
else
{
Session["Server_Name"] = Request.Form["txtServerName"];
}
if (isValidUser((String)Session["Server_Name"], frmLogin.UserName,frmLogin.P
assword))
{
Session["Server_Username"] = frmLogin.UserName;
Session["Server_Password"] = frmLogin.Password;
FormsAuthentication.RedirectFromLoginPage(frmLogin.UserName, false);
Response.End();
}
else
{
//FailureText.Text = "Access Denied!";
//Response.End();
}
}
When isValid returns true, it is ok, and redirected to another page, but whe
n isValid return false, the error occrus then, the error message is:
An error has occurred while establishing a connection to the server. When c
onnecting to SQL Server 2005, this failure may be caused by the fact that un
der the default settings SQL Server does not allow remote connections. (prov
ider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Spe
cified)
Description: An unhandled exception occurred during the execution of the cur
rent web request. Please review the stack trace for more information about t
he error and where it originated in the code.
SQLExpress database file auto-creation error:
The connection string specifies a local Sql Server Express instance using a
database location within the applications App_Data directory. The provider a
ttempted to automatically create the application services database because t
he provider determined that the database does not exist. The following confi
guration requirements are necessary to successfully check for existence of t
he application services database and automatically create the application se
rvices database:
1.. If the applications App_Data directory does not already exist, the web s
erver account must have read and write access to the applications directory.
This is necessary because the web server account will automatically create
the App_Data directory if it does not already exist.
2.. If the applications App_Data directory already exists, the web server ac
count only requires read and write access to the applications App_Data direc
tory. This is necessary because the web server account will attempt to verif
y that the Sql Server Express database already exists within the application
s App_Data directory. Revoking read access on the App_Data directory from th
e web server account will prevent the provider from correctly determining if
the Sql Server Express database already exists. This will cause an error wh
en the provider attempts to create a duplicate of an already existing databa
se. Write access is required because the web server accounts credentials are
used when creating the new database.
3.. Sql Server Express must be installed on the machine.
4.. The process identity for the web server account must have a local user p
rofile. See the readme document for details on how to create a local user pr
ofile for both machine and domain accounts.
However I did not install and not running the SQL Express Edition, I want to
know why the ASPX is connecting to the SQL Server but there is no code for
the SQL <-> ASP.NET Connections.
Thank you.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment