Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 935729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:12:12+00:00 2026-05-15T21:12:12+00:00

I read a delimited text file into dataset. i am writing these dataset values

  • 0

I read a delimited text file into dataset. i am writing these dataset values line by line in another text file. my C# syntax is :

try
            {
                DataClasses1DataContext db = new DataClasses1DataContext();

                var r = from p in db.Products
                        select p;
                //DataTable TarGetTable;
                //TarGetTable = AddDataToTable();
                String TargetStringFilePath;
                TargetStringFilePath = @"c:\aaa.txt";
                StreamWriter fw = File.CreateText(TargetStringFilePath);

                foreach (Product drPrintRow in r)
                {

                    //drPrintRow[drPrintRow]
                    String str = drPrintRow.CategoryID.ToString();
                    str +=" "+ drPrintRow.Discontinued.ToString();
                    str +=" "+ drPrintRow.ProductID.ToString();
                    str += " "+drPrintRow.ProductName.sToString();
                    fw.WriteLine(str);
                }


                fw.Flush();

                fw.Close();
                //}
            }
            catch (Exception ex)
            {
            }

I want this output in bellow format

                                        CUSTOMERWISE ORDER STATUS REPORT
                                        ================================
 Trading Date : 1-2-2010                                                                           Date :1-2-2010
                                                                                                     Time :15:00:52                    
      HOWLA TYPE               FILL TYPE              MKT TYPE                   ORDER STATUS                     
    --------------     -------------------------     -----------     ---------------------------------------------
    D : DVP            MF   : MinimumFill            P : PUBLIC      AC : ACTIVE       CF : CompletelyFilled      
    N : NORMAL         PF   : Partial Fill           S : SPOT        NA : NOTACTIVE    FR : FilledAndRejected     
    U : UNSPECIFIED    FOK  : FillOrKill             O : ODDLOT      XE : Executed     EX : Expired               
                       AON  : AllOrNone              B : BLOCK       RJ : Rejected     OM : OriginalOrderModified 
                       PFAK : PartialFillAndKill                     DE : Deactivated  PF : PartiallyFilled       
                                                                     DL : Deleted      CR : CrossingReported      
_______________________________________________________________________________________________________________________
CUSTOMER  |INSTRUMENT| BROKER  | Quantity|B |   PRICE  | BALANCE |HOWLA| EXPIRY   | MKT|FILL|ORDER |  TORN   |  TORN   |
          |          | ORDER   |         |/ |    Tk.   |   QTY   |TYPE | DATE     |TYPE|TYPE|STATUS| PREFIX  | SUFFIX  |
          |          | REFNO   |         |S |          |         |     |          |    |    |      |   NO    |   NO    |
__________|__________|_________|_________|__|__________|_________|_____|__________|____|____|______|_________|_________|
00002     |BSRMSTEEL |109379297|      500|S |   1325.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 41500123|
          |CITYBANK  |109379298|      200|S |    940.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  6300609|
          |POWERGRID |109379303|      500|S |    789.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  6000269|
          |SPCERAMICS|109379306|     5000|S |     93.60|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 40200627|
          |CITYBANK  |109379439|     2000|S |    912.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  6300918|
00004     |PREMIERBAN|109379645|      550|B |    402.75|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 32601990|
          |PLFSL     |109379725|      100|B |    660.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 27800430|
          |MAKSONSPIN|109379373|     2000|S |    110.70|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 41400304|
          |MPETROLEUM|109379654|      100|S |    329.00|      100|  N  |01-02-2010| P  | PF |  AC  |201003201| 36001036|
          |BXPHARMA  |109379867|      200|S |    185.50|      200|  N  |01-02-2010| P  | PF |  AC  |201003201|  9302082|
00011     |PADMAOIL  |109379692|     1000|S |    811.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 15500272|
          |MPETROLEUM|109379989|     1000|S |    324.70|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 36001454|
          |CONFIDCEM |109380341|      500|S |   1614.75|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  6500878|
          |          |109380346|      500|S |   1616.00|      240|  N  |01-02-2010| P  | PF |  PF  |201003201|  6500891|
          |          |109380351|      500|S |   1615.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  6500905|
00012     |APEXTANRY |109379064|      100|B |   1373.50|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  1300042|
          |          |109379154|      100|B |   1365.00|      100|  N  |01-02-2010| P  | PF |  AC  |201003201|  1300127|
          |          |109379328|      100|B |   1385.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  1300301|
          |UNIONCAP  |109379471|      500|B |    143.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  8000591|
          |          |109379535|      500|B |    143.50|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  8000651|
          |          |109379774|     1000|B |    142.30|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  8000931|
          |          |109380425|      500|B |    142.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  8001532|
          |PREMIERBAN|109379218|      100|S |    399.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 32600814|
          |SUMITPOWER|109380383|      100|S |   1324.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 28401076|
          |          |109380438|       50|S |   1321.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201| 28401129|
00013     |APEXTANRY |109379034|      100|B |   1375.00|        0|  N  |01-02-2010| P  | PF |  CF  |201003201|  1300016|

How to write dataset value in text file in specified format.Is there any existing software that can do that for me.

I use Northwind database on C# syntax.HOw to write this product table information in above format.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T21:12:13+00:00Added an answer on May 15, 2026 at 9:12 pm

    I’d suggest starting with the string.Format method and check the additional references on the documentation page for help in determining the proper custom format strings.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Alright, I'm trying to read a comma delimited file and then put that into
I am trying to read a text file into matlab where the text file
I'd like to use lex/yacc to read in a delimited text file. This would
I'm trying to read a text file that contains integers and store them into
I need to know how to read data from tabbed delimited text file in
I need to read from a variety of different text files (I've some delimited
What is the best way to read in a tab delimited file in C++
I have a space delimited text file I am reading and am trying to
Im using a function to return a text file that is tab delimited and
How do I read into an array a string with space in it, delimited

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.