Hi Neil,
From your description, however, I'm unsure of your process of the
application and what query you would like to execute. Do you want to make
..net application query different database? Would you please show me your
process of application as detail as possible?
Base on my understand, you want to
1. get an input of database name and path(you have many different database
file in different file path)
2. do some query in the database you specified
3. show the query result in your .net application
In this case, I suggest that it is not necessary to use database name and
path as a parameter. in SQL query, instead you'd better make the query in
..net like this:
// Use constructor arguments to configure command object
SqlCommand cmd = new SqlCommand( "SELECT * FROM PRODUCTS", conn );
// The above line is functionally equivalent to the following
// three lines which set properties explicitly
sqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT * FROM PRODUCTS";
It will be the same case, if you want to use the query in database.
More detailed information can be find at
..NET Data Access Architecture Guide
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/
daag.asp
Hope this help and detailed information that you can provide will make
things clear and help us move closer to the causes and resolutions.
Sincerely yours,
Michael Cheng
Microsoft Online Support
***********************************************************
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
Please reply to newsgroups only, many thanks.