Results 1 to 4 of 4

Thread: Reading a string from a text

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Dhaka, Bangladesh
    Posts
    102

    Reading a string from a text

    Dear Friends,

    I have an application developed by C#.NET. I want to read the connection string of a database from a txt file.

    How can I read a string from a txt file in C#.NET platform. Please help (with example if possible) .

    Waiting for ur quick response....

    Rajib
    Please Rate every reply if it is useful to u

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Reading a string from a text

    Create a StreamReader object and call its ReadLine method.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2005
    Location
    Dhaka, Bangladesh
    Posts
    102

    Re: Reading a string from a text

    Please describe more with example...

    -Rajib
    Please Rate every reply if it is useful to u

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Reading a string from a text

    Have a look at the help/MSDN topic for the StreamReader class. It provides links to code examples for numerous I/O operations.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width