Friends,
My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount
At the time of writing a text file I use in a for loop -
String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.
Rahul
My Problem is related to writing a text file from a database
using .Net. in a particular string format.
I have a dataset with a table, let suppose in this table there are
three fields.
- Code
- Description
- Amount
At the time of writing a text file I use in a for loop -
String.Format(" {0,10}{1, 40} {2,-10}", DS.Table(0).Row (i)
("Code").ToStri ng(), DS.Table(0).Row (i)("Descriptio n").ToString (),
DS.Table(0).Row (i)("Amount").T oString())
But the problem is related to the alignment. Data comes like in
following format:
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
I want Data comes in following proper alignment format.
01Code 01Desc 2000
02Code 02Desc 3000
03CodeABC 03Desc 4000
04xyz 04Desc 5000
So anybody knows the solutions of this problem, please and please
reply imediately, its urgent.
Rahul
Comment