Answered Please help!

  • Monday, April 02, 2012 7:40 AM
     
     

    This is the error I get at event log. This problem has been occuring for a while now..

    The process was terminated due to an unhandled exception. Exception Info: System.Data.SqlClient.SqlException Stack: at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(System.Data.Common.DbConnection, System.Data.ProviderBase.DbConnectionFactory) at System.Data.SqlClient.SqlConnection.Open() at System.Data.Linq.SqlClient.SqlConnectionManager.UseConnection(System.Data.Linq.SqlClient.IConnectionUser) at System.Data.Linq.SqlClient.SqlProvider.get_IsSqlCe() at System.Data.Linq.SqlClient.SqlProvider.InitializeProviderMode() at System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(System.Linq.Expressions.Expression) at System.Data.Linq.DataQuery`1[[System.__Canon, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]].System.Collections.Generic.IEnumerable<T>.GetEnumerator() at AtaDocLab.Login.btnLogin_Click(System.Object, System.Windows.RoutedEventArgs) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(System.Object, System.Windows.RoutedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(System.Object, System.Windows.RoutedEventArgs, Boolean) at System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs) at System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs) at System.Windows.Controls.Primitives.ButtonBase.OnClick() at System.Windows.Controls.Button.OnClick() at System.Windows.Controls.Primitives.ButtonBase.OnAccessKey(System.Windows.Input.AccessKeyEventArgs) at System.Windows.Input.AccessKeyManager.ProcessKey(System.Collections.Generic.List`1<System.Windows.IInputElement>, System.String, Boolean, Boolean) at System.Windows.Input.AccessKeyManager.ProcessKeyForSender(System.Object, System.String, Boolean, Boolean) at System.Windows.Input.AccessKeyManager.OnKeyDown(System.Windows.Input.KeyEventArgs) at System.Windows.Input.AccessKeyManager.PostProcessInput(System.Object, System.Windows.Input.ProcessInputEventArgs) at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(System.Windows.Input.ProcessInputEventHandler, System.Windows.Input.ProcessInputEventArgs) at System.Windows.Input.InputManager.ProcessStagingArea() at System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs) at System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport) at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr, System.Windows.Input.InputMode, Int32, System.Windows.Input.RawKeyboardActions, Int32, Boolean, Boolean, Int32) at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(System.Windows.Interop.MSG ByRef, Boolean ByRef) at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(System.Windows.Interop.MSG ByRef, System.Windows.Input.ModifierKeys) at System.Windows.Interop.HwndSource.OnPreprocessMessage(System.Object) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32) at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate) at System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32) at System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority, System.Delegate, System.Object) at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(System.Windows.Interop.MSG ByRef, Boolean ByRef) at System.Windows.Interop.HwndSource+WeakEventPreprocessMessage.OnPreprocessMessage(System.Windows.Interop.MSG ByRef, Boolean ByRef) at System.Windows.Interop.ThreadMessageEventHandler.Invoke(System.Windows.Interop.MSG ByRef, Boolean ByRef) at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(System.Windows.Interop.MSG ByRef) at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame) at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame) at System.Windows.Threading.Dispatcher.Run() at System.Windows.Application.RunDispatcher(System.Object) at System.Windows.Application.RunInternal(System.Windows.Window) at System.Windows.Application.Run(System.Windows.Window) at System.Windows.Application.Run() at AtaDocLab.App.Main()

    • Moved by Annabella Luo Wednesday, April 04, 2012 5:46 AM (From:Windows Presentation Foundation (WPF))
    •  

All Replies

  • Monday, April 02, 2012 8:30 AM
     
     

    Hi

    Pace Nash

    Can you please share your code so that we can better understand your issue.....


    Harshad..... Always 4 U

  • Wednesday, April 04, 2012 5:46 AM
     
     

    Hi Pace,

    Thank you for your post.

    According to the exception information you provided, I think this is a exception thrown when SQL connection, so I'm moving your thread to linq to sql Forum so that you can get a better help.

    Thank you for your understanding.

    Have a nice day.


    Annabella Luo[MSFT]
    MSDN Community Support | Feedback to us

  • Wednesday, April 04, 2012 5:54 AM
    Moderator
     
     Answered

    Hi,

    Here is a troubleshooting about "System.Data.SqlClient.SqlException": http://msdn.microsoft.com/en-us/library/24xy33d0.aspx

    ------------------------------------------------

    Verify that you are connecting with valid credentials.
    Make sure that the credentials you are supplying are valid.

    Verify that the server name is correct and that the server is running.
    Make sure that you are using the correct server name, and that the server can be reached.

    ------------------------------------------------

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked As Answer by Pace Nash Saturday, April 14, 2012 5:16 PM
    •  
  • Wednesday, April 04, 2012 10:06 AM
     
     

    If it is something with a connection that is closed, and therefore you can't close it, then at least start of by catching it in:

    AtaDocLab.App.Main()

    And if nothing else then suppressing it.