Thread: SQL server...
View Single Post
  #1 (permalink)  
Old February 3rd, 2004, 12:02 AM
Michael Randall Michael Randall is offline
Authorized User
 
Join Date: Jan 2004
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default SQL server...

Hi, I am working on the project in Beginning Web Programming VB.NET and Visual Studio.NET

The database for this project was contained within a file called Friends_Data.MDF The instructions said to attach this file to the MSDE server, which I did. I am now trying to access the database via a web form to create a new entry in the database. The connection string I am using is

con = New SqlConnection("data source=(NetSdk;initial catalog=Friends;user id=sa")

However, when trying to create a new entry I get the error listed below. Does anyone have any idea on how I can correct this problem?

Thanks much,

Michael

Error Message:

Code:
Exception Details: System.Data.SqlClient.SqlException: SQL Server does not exist or access denied.

Source Error: 


Line 101:            con = New SqlConnection("data source=(local)\NetSdk;initial catalog=Friends;user id=sa")
Line 102:            cmd = New SqlCommand(sql, con)
Line 103:            con.Open()
Line 104:
Line 105:            Try
 

Source File: c:\inetpub\wwwroot\FriendsReunionUI\secure\NewUser.aspx.vb    Line: 103 

Stack Trace: 


[SqlException: SQL Server does not exist or access denied.]
   System.Data.SqlClient.ConnectionPool.GetConnection(Boolean& isInTransaction)
   System.Data.SqlClient.SqlConnectionPoolManager.GetPooledConnection(SqlConnectionString options, Boolean& isInTransaction)
   System.Data.SqlClient.SqlConnection.Open()
   FriendsReunionUI.NewUser.btnAccept_Click(Object sender, EventArgs e) in c:\inetpub\wwwroot\FriendsReunionUI\secure\NewUser.aspx.vb:103
   System.Web.UI.WebControls.Button.OnClick(EventArgs e)
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
   System.Web.UI.Page.ProcessRequestMain()
I am using Windows NT Integrated security to log into the database.