Saturday, April 14, 2012

[C#] ExecuteNonQuery script to create database with GO word

You develop a business application, it use SQL server database. So before deliver you need to create setup package, it will auto run sql create database.
Then, you found ExecuteNonQuery statement to use to run sql script. But we have some issue in here. It can run only one sql statement in each times, I mean if you use GO, it will false to run. OK, here is a simple way to solve it.