After searching Google, and finding only answers to XML indent, "just use Visual Studio's auto indent" and "that would be crazy to write your own auto-indenter" I've decided to come to the good place: StackOverflow...
Question: 1. How do I add an 'indent' to a programmatically created file? - I would be generating the files via the System.IO class / streamwriter, unless someone can tell me of a better way, I just want to generate a file from my asp.net page, a windows app or possible a batch file (well, maybe not this last one)... to generate a class file, such as Employee.vb OR EmployeeDAL.vb
Why: I've decided that I'm a bit bored of writing the same BOL and DAL code for every database table I write, and at the moment I'm stuck with ASP.NET due to work constraints, otherwise I would just move over to something like Ruby on Rails or some PHP framework, but this isn't an option, so please don't suggest this.
So... I know how to get the names of all my table columns, their data types, their lengths,... yadda yaddda..., and I haven't actually fleshed out a working file, but from experience / knowledge, and a bit of googling I think the main bits will be 'fairly easy'.
However all I really want to know, is how to I add an indentation when I create my file?
Over thinking it: Perhaps, I'm over thinking it, and when I sit down to write it, I'll realise, I just need to add some spaces to my string...
" private _" & db_field_name & " as " variable_type(db_type)
- Any help appreciated...
- Cheers.
Ps... We're using .NET 2.0 - I know, I know, there are so many reasons we should be using Ruby, PHP, or .NET 4.0 (hopefully this is coming this year - to our team) - but there is nothing I can do about it at the moment, and we use .NET.