SQL script execution

B

Brian Henry

is there anyway to execute a saved .SQL script file through ADO.net? I want
to automate database creation based on a SQL script I can easily edit...
Thanks
 
W

William Ryan

There may be a more elegant way, but you can read the file in using a file
stream and then set the text to a string which is in turn used as the
commandtext of your command object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top