Error Reading from a Text File

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave Bailey

    #1

    Error Reading from a Text File

    I have added a text file to a C# Web Project. I have
    placed an oledbconnection string into the text file. I
    can read the information and place the connection string
    into a text box which is not visible. When I load the
    connection string from the text box as follows:

    string connStr = connectText.Tex t:

    and run the program, I get the following error:

    Format of the initialization string does not conform to
    specification starting at index 21

    Can anyone help with this.

    Thanks,

    Dave
  • Cliff Harris

    #2
    Re: Error Reading from a Text File

    Could you provide us with the line of code that is causing the error?
    Without having that, my best guess is that the error occurs when you are
    trying to open the connection on your dbconnection object.
    My guess is that the string is loading up ok, but that your connection
    string is mal-formed. Try to use the same connection string without loading
    it from a text file, and see if you still get the error.
    If you can provide a code snipet, one of us may have a more definitive
    answer for you.

    HTH,
    -Cliff

    "Dave Bailey" <anonymous@disc ussions.microso ft.com> wrote in message
    news:0b4001c3af 76$a848c950$a50 1280a@phx.gbl.. .[color=blue]
    > I have added a text file to a C# Web Project. I have
    > placed an oledbconnection string into the text file. I
    > can read the information and place the connection string
    > into a text box which is not visible. When I load the
    > connection string from the text box as follows:
    >
    > string connStr = connectText.Tex t:
    >
    > and run the program, I get the following error:
    >
    > Format of the initialization string does not conform to
    > specification starting at index 21
    >
    > Can anyone help with this.
    >
    > Thanks,
    >
    > Dave[/color]


    Comment

    Working...