I have a project I am working on with a database with several tables. I use asp.net security to log in.
On my own laptop I can connect to all the tables and log in fine. I submitted the project and the lecturer said he couldn't log in, so I tried it on another laptop - I get a SQL error when trying to log in, but I can see all the tables. The same connection string is used for all the tables in the database, it is just the log in that triggers the error. I suspect it is something to do with asp.net.
Here is my web.config file, which I think is the most relevant thing to show here:
<configuration>
<appSettings>
<add key="ValidationSettings:UnobtrusiveValidationMode" value="None"/>
</appSettings>
<connectionStrings>
<add name="ProductsConnectionString" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\Products.mdf;Integrated Security=True" providerName="AspNetSqlProvider" />
</connectionStrings>
<system.web>
<roleManager enabled="true"/>
<compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/>
<authentication mode="Forms" />
<httpRuntime targetFramework="4.5"/>
</system.web>
</configuration>
The error I get is as follows:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)
Source Error:
Line 12: End If
Line 13:
Line 14: If Membership.ValidateUser(lgnMain.UserName, lgnMain.Password) Then
Line 15: e.Authenticated = True Line 16:
Has anyone any suggestions on how to make the log in work on more than one machine?