Open Github743 opened 6 years ago
For avoiding max length for date time, int and bit use this code
if (type.Name != "int" && type.Name != "datetime" && type.Name != "bit") tableColumnsNode.Nodes.Add(c.Name + " (" + type.Name + "[" + type.MaxLength + "])"); else tableColumnsNode.Nodes.Add(c.Name + " (" + type.Name + ")");
This helped me a lot in restoring my database with the MDF file I had. A sample code which may help others to save as script file. Replace the method addTablesNode with the following code