Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / June 2007

Tip: Looking for answers? Try searching our database.

String Alignment problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Rahul - 04 Jun 2007 06:07 GMT
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").ToString(), DS.Table(0).Row(i)("Description").ToString(),
DS.Table(0).Row(i)("Amount").ToString())

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
Bryan Phillips - 06 Jun 2007 02:40 GMT
Are you using a fixed-width font?

--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com
Web Site:  http://www.composablesystems.net

> Friends,
>
[quoted text clipped - 31 lines]
>
> Rahul

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.