|No to the VBA, no Entity Framework, no LINQtoSQL; I am an ADO purist.
But I'll try to explain the process if it helps. After typing this it does seems really wordy and long but after many years of doing it this way it is only a matter of minutes.
The process for SQL design to a class is similar.
- Create class properties in C#
- Copy the properties and paste in Notepad
- Use find/replace to replace spaces with tabs
- Copy the contents and paste into Excel
- Add column for natural index (1,2,3)
- Sort by Net Data Type
- Add column for SQL Data Type alongside NET data type, and populate
- Rerrange columns around to match format of CREATE TABLE syntax
- Copy and paste the desired columns into SSMS new query window
I also reuse/tweak the Excel content to create instances (overloaded constructs) from IDataReaders or DataRows.
Director of Transmogrification Services
Shinobi of Query Language
Master of Yoda Conditional