c# - Server Error in '/' Application (ASP.NET) -


i setup member ship roles , registration on website visual web developer using tutorial on msdn. works locally, when uploaded server, following page:

"server error in '/' application. --------------------------------------------------------------------------------  configuration error  description: error occurred during processing of configuration file required service request. please review specific error details below , modify configuration file appropriately.   parser error message: connection name 'localsqlserver' not found in applications configuration or connection string empty.  source error:    [no relevant source lines]   source file: machine.config    line: 160    -------------------------------------------------------------------------------- version information: microsoft .net framework version:2.0.50727.4200; asp.net version:2.0.50727.4016 " 

does know why i'm seeing , how may go fixinf this? appreciated.

thank you

bael.

edit:

i have looked @ web.config file after reading following line in error message: "the connection name 'localsqlserver' not found in applications configuration or connection string empty." ... , have noticed following element empty:

<connectionstrings/> // 1 supposed empty? if not should go here? in error implies shouldn't empty. also, don't know should place localsqlserver

latest edit

after changing datasource localhost following error:

server error in '/jts' application. --------------------------------------------------------------------------------  network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)  description: unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code.   exception details: system.data.sqlclient.sqlexception: network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)  source error:   unhandled exception generated during execution of current web request. information regarding origin , location of exception can identified using exception stack trace below.    stack trace:    [sqlexception (0x80131904): network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: named pipes provider, error: 40 - not open connection sql server)]    system.data.sqlclient.sqlinternalconnection.onerror(sqlexception exception, boolean breakconnection) +4849015    system.data.sqlclient.tdsparser.throwexceptionandwarning(tdsparserstateobject stateobj) +194    system.data.sqlclient.tdsparser.connect(serverinfo serverinfo, sqlinternalconnectiontds connhandler, boolean ignoresniopentimeout, int64 timerexpire, boolean encrypt, boolean trustservercert, boolean integratedsecurity, sqlconnection owningobject) +4862333    system.data.sqlclient.sqlinternalconnectiontds.attemptonelogin(serverinfo serverinfo, string newpassword, boolean ignoresniopentimeout, int64 timerexpire, sqlconnection owningobject) +90    system.data.sqlclient.sqlinternalconnectiontds.loginnofailover(string host, string newpassword, boolean redirecteduserinstance, sqlconnection owningobject, sqlconnectionstring connectionoptions, int64 timerstart) +342    system.data.sqlclient.sqlinternalconnectiontds.openloginenlist(sqlconnection owningobject, sqlconnectionstring connectionoptions, string newpassword, boolean redirecteduserinstance) +221    system.data.sqlclient.sqlinternalconnectiontds..ctor(dbconnectionpoolidentity identity, sqlconnectionstring connectionoptions, object providerinfo, string newpassword, sqlconnection owningobject, boolean redirecteduserinstance) +189    system.data.sqlclient.sqlconnectionfactory.createconnection(dbconnectionoptions options, object poolgroupproviderinfo, dbconnectionpool pool, dbconnection owningconnection) +185    system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection owningconnection, dbconnectionpool pool, dbconnectionoptions options) +31    system.data.providerbase.dbconnectionpool.createobject(dbconnection owningobject) +433    system.data.providerbase.dbconnectionpool.usercreaterequest(dbconnection owningobject) +66    system.data.providerbase.dbconnectionpool.getconnection(dbconnection owningobject) +499    system.data.providerbase.dbconnectionfactory.getconnection(dbconnection owningconnection) +65    system.data.providerbase.dbconnectionclosed.openconnection(dbconnection outerconnection, dbconnectionfactory connectionfactory) +117    system.data.sqlclient.sqlconnection.open() +122    system.web.dataaccess.sqlconnectionholder.open(httpcontext context, boolean revertimpersonate) +87    system.web.dataaccess.sqlconnectionhelper.getconnection(string connectionstring, boolean revertimpersonation) +221    system.web.security.sqlmembershipprovider.getpasswordwithformat(string username, boolean updatelastloginactivitydate, int32& status, string& password, int32& passwordformat, string& passwordsalt, int32& failedpasswordattemptcount, int32& failedpasswordanswerattemptcount, boolean& isapproved, datetime& lastlogindate, datetime& lastactivitydate) +815    system.web.security.sqlmembershipprovider.checkpassword(string username, string password, boolean updatelastloginactivitydate, boolean failifnotapproved, string& salt, int32& passwordformat) +105    system.web.security.sqlmembershipprovider.checkpassword(string username, string password, boolean updatelastloginactivitydate, boolean failifnotapproved) +42    system.web.security.sqlmembershipprovider.validateuser(string username, string password) +78    system.web.ui.webcontrols.login.authenticateusingmembershipprovider(authenticateeventargs e) +60    system.web.ui.webcontrols.login.onauthenticate(authenticateeventargs e) +119    system.web.ui.webcontrols.login.attemptlogin() +115    system.web.ui.webcontrols.login.onbubbleevent(object source, eventargs e) +101    system.web.ui.control.raisebubbleevent(object source, eventargs args) +37    system.web.ui.webcontrols.button.oncommand(commandeventargs e) +118    system.web.ui.webcontrols.button.raisepostbackevent(string eventargument) +166    system.web.ui.webcontrols.button.system.web.ui.ipostbackeventhandler.raisepostbackevent(string eventargument) +10    system.web.ui.page.raisepostbackevent(ipostbackeventhandler sourcecontrol, string eventargument) +13    system.web.ui.page.raisepostbackevent(namevaluecollection postdata) +36    system.web.ui.page.processrequestmain(boolean includestagesbeforeasyncpoint, boolean includestagesafterasyncpoint) +1565     -------------------------------------------------------------------------------- version information: microsoft .net framework version:2.0.50727.4927; asp.net version:2.0.50727.4927  

localsqlserver default connection string entry in machine.config. present although not in app/web config file.

it points local instance of sqlexpress installed visual studio.

by default membership provider, upon configuration, creates local .mdf file in app_data folder (click show files). database has been provisioned.

if reason want use different database must provision aspnet_regsql.exe . find in windows/microsoft.net/framework/2.0.xxxx directory.

from commandline run aspnet_regsql.exe /? instructions.

so.. may why getting these errors. if want use different database , not want edit membership section point new db must remove localsqlserver , re-add

or, again, configure membership element point different connection.

either way need provisioned database other local user instance provisioned vs using during development , connection string points it.

<connectionstrings>   <remove name='localsqlserver' />   <add name='localsqlserver' connectionstring='data source=dbservername;     integrated security=false;initial catalog=dbname;     user id=dblogin;password=dbpassword' providername='system.data.sqlclient' /> </connectionstrings> 

edit: reread question:

the problem host not have sql or not allow user instances. typically in hosted site, request database , upon getting credentials, use aspnet_regsql.exe provision database. in case must modify membership section in web.config point new database.

hth


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -