issue command line statements

G

Guest

how would I run osql command from within console or windows application?

For e.g. how would I run following command, which I normally type on command
prompt

osql /U alma /P mypassword /i titles.qry /o titles.res

thanx
 
D

Daniel O'Connell [C# MVP]

Job Lot said:
how would I run osql command from within console or windows application?

For e.g. how would I run following command, which I normally type on
command
prompt

osql /U alma /P mypassword /i titles.qry /o titles.res

By using the Process class, something like:

using System.Diagnostics;
//...
Process.Start("x:\<path-to-osql>\osql.exe", "/U alma /P mypassword /i
titles.qry /o titles.res");

Examine the other overloads of start and the other members of Process for
more flexibility
 

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