I just used part 1 and part 2 of this tutorial and I did all the installation/configuration, but when I try to run my page, I get the following error:
I cannot find any resolution, anyone? thanks.
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:
Named Pipes Provider, error: 40 - Could not open a connection to SQL
Server)
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>Type of Property</td>
<td><asp:DropDownList runat="server" ID="DDLPropertyType" DataSourceID="ODSPropertyType"></asp:DropDownList></td>
</tr>
</table>
<asp:ObjectDataSource runat="server" ID="ODSPropertyType" TypeName="DataAccess.DataReader" SelectMethod="GetPropertyTypes">
</asp:ObjectDataSource>
</div>
</form>
</body>
namespace DataAccess
{
public class DataReader
{
public static DataSet GetPropertyTypes()
{
string connectionString = "server=localhost; user id=Developer; password=mypassword; database=mydatabase; pooling=false;";
SqlConnection sqlConnection = new SqlConnection(connectionString);
string queryString = "select * From propertytypes order by propertytypedescription";
SqlDataAdapter dataAdapter = new SqlDataAdapter(queryString, sqlConnection);
DataSet dsPropertyTypes = new DataSet();
dataAdapter.Fill(dsPropertyTypes);
return dsPropertyTypes;
}
}
}