Escape ;(semicolon) in odbc connection string in app.config
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Escape ;(semicolon) in odbc connection string in app.config

  1. #1
    Join Date
    Mar 2014
    Posts
    2

    Escape ;(semicolon) in odbc connection string in app.config

    I have created a windows form with certain fields. I am trying to interact with oracle database through ODBC DSN connections.

    I have an issue in the below connection string in app.config .

    In the connection string password contains semicolon(here abc;45). I am getting an error:

    "Format of the initialization string does not conform to specification starting at index 35" while i am trying to access this connection string using OdbcConnection connection = new OdbcConnection(connection_string); in C# code.

    Below is my connection string.

    <add name="ConnectionString_T1" connectionString="DSN=CLA_T5;Uid=abc;Pwd=abc;45" providerName="System.Data.Odbc" />
    I pass the connection string to the below class.
    OdbcConnection connection = new OdbcConnection(connection_string);
    PS: I tried putting this password in double quotes/single quote/" ,&quot; ,{}
    But no use. Still facing this error. I have tried putting all the escape sequences

  2. #2
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,358

    Re: Escape ;(semicolon) in odbc connection string in app.config

    It isn't an escape issue. The problem is OdbcConnection doesn't allow the semi-colon.

  3. #3
    Join Date
    Mar 2014
    Posts
    2

    Re: Escape ;(semicolon) in odbc connection string in app.config

    Quote Originally Posted by Arjay View Post
    It isn't an escape issue. The problem is OdbcConnection doesn't allow the semi-colon.
    [Punith]: Is there any way to work with passwords like this using ODBCConnection. Any other alternatives?

  4. #4
    Join Date
    Jan 2006
    Location
    Chicago, IL
    Posts
    14,984

    Re: Escape ;(semicolon) in odbc connection string in app.config

    Try is SQL Management Studio. It's easier on error. Points to a specific location
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Tags for this Thread

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center