SqlClient Connection Works Fine with XP, will not work on Windows 7 RRS feed

  • Question

  • Hello, I am programming in VS2010 wirting a simple windows forms program. I am using the for a connection. My data Connection code:

    'Used for reading data only



    Public Function Opendatabase1(ByVal SelectStatement As String) As Boolean




    MyCommand =


    New SqlClient.SqlCommand()



    With MyCommand

    .Connection =


    New SqlClient.SqlConnection(strConn)


    .CommandText = SelectStatement

    MyDataReader = .ExecuteReader()



    End With




    the connection string is:





    Const strConn As String = "Data Source=SQL2K8;Initial Catalog=PropertyManagement;Integrated Security=True"T




    The compiled program runs just fine on an XP box, but will not run on my development Windows 7 Computer. The worst thing about it is I can create a Dataset connection using Data Source configuration wizard, and it can connect and examine the data just fine. I checked the connection string it is exactly the same. I am pulling my Hair out on this one.

    I just got the Windows 7 Box.


    • Moved by SamAgain Wednesday, September 29, 2010 3:22 AM better fit (From:64-Bit .NET Framework Development.)
    Monday, September 27, 2010 3:48 PM

All replies

  • Do you receive any error message from the application? Can you post it here?
    Val Mazur (MVP)
    Thursday, September 30, 2010 10:23 AM
  • Yeah, you need provide a bit more information, such as any exceptions that are being generated by your code.

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Thursday, September 30, 2010 5:12 PM