Hmmm..
Tel me if u did this:
1. You Right-click on the database, "Create To" to a new SQL Server Window
2. SAve this script as .sql file
3. And now u are trying to run this .sql file using some .Net code.
Is that right man? or are u trying to run the script from SSMS itself??