Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unanswered: System.InvalidOperationException

    Hi

    I wrote code that connects to a SQL Server database in VB .NET
    The program connects to the server and works fine.

    dConnection = New SqlConnection(getCfgProperty(fPropDBConnection))
    dConnection.Open()


    However when I put my code on to a different machine (test server) the program can not open the connection. It gives an exception in the
    dConnection.Open() line:

    System.InvalidOperationException: The ConnectionString property has not been initialized.
    at System.Data.SqlClient.SqlConnection.Open()
    at Project4.HowTo.Samples.ADONET.ReportDistributor.di stributeReports()


    Connection string is correct.

    Is there something that has to be configured on test server environment?

    Thanx

  2. #2
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    What's you connection string? And why can't you just use straight ADO?

  3. #3
    Join Date
    Feb 2004
    Posts
    5
    Originally posted by rdjabarov
    What's you connection string? And why can't you just use straight ADO?

    my connections string is Server=SM1CXX.XX.XX;Uid=XXXX;Pwd=XXX;Database=DBus Contracts

    as i said it connects from my computer fine

    is there something wrong with the string?
    how can I use ADO i thought i was using it

    Dim dbConnection As SqlConnection
    dbConnection = New SqlConnection(getCfgProperty(fPropDBConnection))
    dbConnection.Open()

    Thanx

  4. #4
    Join Date
    Jul 2003
    Location
    San Antonio, TX
    Posts
    3,662
    Hmmm, this looks like an ODBC DSN-less connection string. More like RDO.

  5. #5
    Join Date
    Feb 2004
    Posts
    5
    Originally posted by rdjabarov
    Hmmm, this looks like an ODBC DSN-less connection string. More like RDO.

    should I use something else?

    The strange thing is tha it connects from my machine where i have sql client,
    but it does not connect from the machine where sql server is installed.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •