[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 248
  • Last Modified:

Sql connection error

I have VS2008 windows app that I have been working on for months and all of sudden by connection to my .mdf file is in error.  

If anyone has any insight, please help, because I am at a total lost as to how this is occurring.

Thanks,
My connection string is:
"Data Source=.\SQLEXPRESS;AttachDbFilename='c:\documents and settings\jaydee\my documents\visual studio 2005\projects\statpro\statpro\Database1.mdf';Integrated Security=True;User Instance=True"

The specific error that I am receiving is:

System.Data.SqlClient.SqlException was unhandled
  Class=11
  ErrorCode=-2146232060
  LineNumber=65536
  Message="Cannot open user default database. Login failed. Login failed for user 'JD\JayDee'."
  Number=4064
  Procedure=""
  Server="\\.\pipe\9CC84DFF-2F00-40\tsql\query"
  Source=".Net SqlClient Data Provider"
  State=1
  StackTrace:
       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK)
       at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject)
       at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart)
       at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance)
       at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)
       at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)
       at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
       at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
       at System.Data.SqlClient.SqlConnection.Open()
       at StatPro.MAIN.MAIN_Load(Object sender, EventArgs e) in C:\Documents and Settings\JayDee\My Documents\Visual Studio 2005\Projects\StatPro\StatPro\MAIN.vb:line 22
       at System.EventHandler.Invoke(Object sender, EventArgs e)
       at System.Windows.Forms.Form.OnLoad(EventArgs e)
       at System.Windows.Forms.Form.OnCreateControl()
       at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
       at System.Windows.Forms.Control.CreateControl()
       at System.Windows.Forms.Control.WmShowWindow(Message& m)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
       at System.Windows.Forms.ContainerControl.WndProc(Message& m)
       at System.Windows.Forms.Form.WmShowWindow(Message& m)
       at System.Windows.Forms.Form.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
       at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
       at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
       at System.Windows.Forms.Control.set_Visible(Boolean value)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(ApplicationContext context)
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
       at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
       at StatPro.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
       at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
       at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
       at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
       at System.Activator.CreateInstance(ActivationContext activationContext)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:
0
nationaltravel
Asked:
nationaltravel
  • 12
  • 6
1 Solution
 
59calCommented:
has the SQL login been disabled?
0
 
59calCommented:
or even locked out?
0
 
nationaltravelAuthor Commented:
@59Cal

Not to my knowlegdge.  How can I check either of these?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
59calCommented:
Open up SQL management studio and try and connect to the SQL instance. If this connects, then the account is not logged out
0
 
nationaltravelAuthor Commented:
Is there another method as I do not have SQL managment studio?
0
 
59calCommented:
not that i know of. you can download SQL Management studio express. Its a free download from MS
0
 
nationaltravelAuthor Commented:
Thanks.  I am doing so now.
0
 
nationaltravelAuthor Commented:
I have downloaded the studio and now i am receiving the following error message:

TITLE: Connect to Server
------------------------------

Cannot connect to JD\MSSMLBIZ.

------------------------------
ADDITIONAL INFORMATION:

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: Shared Memory Provider, error: 40 - Could not open a connection to SQL Server) (Microsoft SQL Server, Error: 2)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=2&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------
0
 
nationaltravelAuthor Commented:
I was able to correct that error, but i am not able to navigate to my .mdf file.
0
 
59calCommented:
is the database listed in Management studio?
0
 
nationaltravelAuthor Commented:
No, it is not.
0
 
nationaltravelAuthor Commented:
Also, i am receiving this error message in the Studio.

Can not create a stable subkey under a volatile parent key.
0
 
Alex_WCommented:
You mean when you navigate in SQL management studio to ...\Database1.mdf it doesnt exist in your program folder?  What about in Explorer?
0
 
nationaltravelAuthor Commented:
Correct, I can not navigate to the .mdf in the Studio.

Yes, I can locate the .mdf in my Explorer.
0
 
59calCommented:
can you attach your mdf file to the SQL instance?
0
 
nationaltravelAuthor Commented:
No, the studio will not allow me to navigate down to it.
0
 
nationaltravelAuthor Commented:
@59cal

No, the studio will not allow me to navigate down into subfolders to attach the .mdf.
0
 
nationaltravelAuthor Commented:
The only solution that I could find to resolve this was to recereate the db.
0
 
nationaltravelAuthor Commented:
I was not finding any anwers and my deadline for completion was approaching quickly, so this was my quickest solution
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 12
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now