databse creation through sql server

Jul 2 2006 6:24 PM

hi i dont know it is right forum to ask this question or not.

 had generated the sql script to create the databse.i had copied the query from there but i gives the static path of mdf files (in query), present on sql server folder without that filename it does not work.
   i m using this query to in ExecuteNoQuery method. 
    problem is how to know that in which drive sql server is installed, and get folder location of installed sql server is installed or get the full path of installed sql server. or any other way to creat database through sql script.