I am new to this forum and also to C#.I need to write data from database to a text file which is a fixed length file.I am using a dataset reader to get the data and writing it to the file. but the problem is i need to append sufficient spaces to each field. how to add spaces and trim each field to specific length from C#? Pls help