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

    Question

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

    'Used for reading data only

     

     

    Public Function Opendatabase1(ByVal SelectStatement As String) As Boolean

     

     

    Try

    MyCommand =

     

    New SqlClient.SqlCommand()

     

     

    With MyCommand

    .Connection =

     

    New SqlClient.SqlConnection(strConn)

    .Connection.Open()

    .CommandText = SelectStatement

    MyDataReader = .ExecuteReader()

     

     

    End With

     

     

     

    the connection string is:

     

    Private

     

     

    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) http://www.xporttools.net
    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