All you need to do is have the first parameter specify a valid connection
string, then thesecond one a valid command.
Then you can just use a OleDbCommand object, using a connection created
fromthe String. YOu can just specify the commandtext property of the
command to be the script. From there, you can call ExecuteNonQuery to fire
it.
Since you're using Access and not Sql Server, you'd need to do some
translating, but you could take a look at Microsoft's Data Access
Applicaiton Block to get an idea about how this works in more complex
scenarios - but in the simplest form - all you'd need to do is what I
mentioned above.
--
W.G. Ryan, MVP
www.tibasolutions.com |
www.devbuzz.com |
www.knowdotnet.com
"Rich III" <Ri*****@discussions.microsoft.com> wrote in message
news:62**********************************@microsof t.com...
Hi C# users;
I am trying to run an SQL Script on an Access database. I can do it
directly, but, what I would like to do is build a dll that I can call and
give it the databasename and the SQLScript filename and have it return an
integer for success or failure.
Example: int ExecuteSqlScript(string databasePathName, string script);
If you have any ideas I would be gratefull
Thanks.
Rich III