Subject: connecting to Northwind in server explorer
Posted By: ssrs.netuser Post Date: 11/14/2003 4:05:59 PM
I am trying to connect to the Northwind database to follow the examples in the beginning asp.net databases book. i have installed visual studio.net 2002 professional, the .net framework, and MSDE. i still am unable to make the connection to the Northwind Database. can anyone help?

Reply By: CraigJones Reply Date: 11/14/2003 4:44:13 PM
What error are you getting?  It also may help to see a copy of the code you are using.

Reply By: ssrs.netuser Reply Date: 11/14/2003 7:39:32 PM
the error says sql server error 4060. i am not using any code i am simply attempting to add the connection to the Northwind Database so i can follow the example code supplied in the beginning asp.net database. i am not sure why i am getting this. the instructions seem so easy and i am already frustrated.

Reply By: cjo Reply Date: 11/16/2003 12:53:27 PM
Try this:

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.OleDb" %>
<script Language="C#" runat="server">
void Page_Load()
{
string strConnect;    
OleDbConnection objConnect = null;
    
strConnect = @"Provider=Microsoft.Jet.OleDb.4.0;Data Source=C:\BegASPNET\Ch12\Northwind.mdb";
    
objConnect = new OleDbConnection(strConnect);
objConnect.Open();
}

</script>

Go to topic 6530

Return to index page 1004
Return to index page 1003
Return to index page 1002
Return to index page 1001
Return to index page 1000
Return to index page 999
Return to index page 998
Return to index page 997
Return to index page 996
Return to index page 995