Can someone show me, or direct me, to a source, that shows me how, and what to change, when deploying a website from a development server running Sql Ex to a production server running Sql server 2005. I can't get the sites to run under Sql server 2005.
They work in Sql Ex. what must I change? The connection string, to what format? and what else? I attached the dB to Sql 2005 and browsed the content in the Sql manager. But can't get the aspx pages to work on the server.
Help please
The connection string format of SQL 2005 should be the same as SQL Ex, only the change should be the data source name and user/password. What the error you got after change to SQL2005?|||It's configured properly as a application, And it is in the root of the application
Parser Error Message:It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
|||Your new error message seems to be an IIS issue, we'd better get help from IIS expert.|||As far as I know, the exception is thrown when an element that is only allowed in the application root is set in a web.config file that is in a subfolder. Please check.|||We have the files in the root and we believe its some connection issue because of all the test we've run. This is a more detailed explanation of what me and my partner have been working on.
Any help would be very very much appreciated as I am about 15 hours into this :(
Background is a development system with ASP.NET 2.0 and SQL express 2005. The server is SQL 2005 standard edition. Any ASPX pages that connect to a database results in errors.
I have 2 identical servers with Windows server 2003, one has SQL Express and the other has SQL Server 2005 standard. that is the only difference between these systems. The scripts that work seamlessly when uploaded to the SQL Express server dont work on the SQL Server 2005
My connection string is
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Datasource=servername;Integrated Security=SSPI;initial catalog=C:\INETPUB\WWWROOT\test\app_data\aspnet.MDF;"
providerName="System.Data.SqlClient" />
two interesting tidbits
1.) No matter what the initial catalog is pointing to, I get the same error. EVEN if the database doesnt exist
Cannot open database "C:\INETPUB\WWWROOT\test\app_data\aspnwet.MDF" requested by the login. The login failed.
Login failed for user 'NT AUTHORITY\NETWORK SERVICE'.
2.) second interesting thing is this, if I change the datasource to "MSSQLSERVER" which is the instance name of SQL 2005. the error changes to
An error has occurred while establishing a connection to the server. When connecting 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: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
I have reinstalled SQL server 2005
I have verified that under SQL Server 2005 Surface Area Configuration that remote connections has Both TCP and Named Pipes enabled
I have verified that under the Network Configuration that the protocols for TCP/IP and Named pipes are enabled.
I have tried atleast 20 different variations of Connectionstrings
I have ran aspnet_regsql against the database
I have verified that the SQL Server Browser is started
I have verified that the TCP/IP is set in Network Configuration to default port 1433
I have gave all authentication rights to Network Service and ASPNET accounts for testing against both the MASTER and ASPNET databases using Management Studio and attaching the Database
I have created a custom SQL account with access to the database in question and added the username password syntax to the connectionstring and get the same login failed message.
If anyone can give any insight that would be MUCH appreciated!! thanks in advance.
You are using SQL 2005 Express default connection for ASPNETDB.MDF which is sitting in App_Data folder within your application. It will not work when you switch to sql 2005 standard because you don't have the SQL 2005 Express version anymore.
This is not for you to use under SQL Server 2005 or 2000.
<remove name="LocalSqlServer" />
<add name="LocalSqlServer" connectionString="Datasource=servername;Integrated Security=SSPI;initial catalog=C:\INETPUB\WWWROOT\test\app_data\aspnet.MDF;"
providerName="System.Data.SqlClient" />
You need a new customized connection to point to this database ASPNETDB.MDFor (all tables from this one). Useaspnet_regsql.exe to generate this database in your target database.
I assume you may combine this one with your database.
After the database is ready, create a connection in your web.config file. Importantly, you need to add customized role and membership provider to point back to your database.
I'll copy some code at the end that works.
<?xml version="1.0"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<connectionStrings>
<add name="yourDB" connectionString="Data Source=yourDBServer;Integrated Security=false;Initial Catalog=YourDBwithASPNETDB.MDF;User ID=yourUser;Password=yourUserPwd" providerName="System.Data.SqlClient" />
</connectionStrings
<system.web>
<roleManager enabled="true"
defaultProvider="CustomizedRoleProvider">
<providers>
<add name="CustomizedRoleProvider"
type="System.Web.Security.SqlRoleProvider"
connectionStringName="yourDB" />
</providers>
</roleManager>
<membership defaultProvider="CustomizedMembershipProvider">
<providers>
<add name="CustomizedMembershipProvider"
type="System.Web.Security.SqlMembershipProvider"
connectionStringName="yourDB"
applicationName="/"
/>
</providers>
</membership>
</system.web>
</configuration>
Please try this.
Let me know if this works or new issues come out.
Have a good sleep and we will be there.
No comments:
Post a Comment