SQL script execution

  • Thread starter Thread starter Brian Henry
  • Start date Start date
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
 
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.
 
Back
Top