AttachDbFilename in DbNameDataSet.xsd

How can I useAttachDbFilename in DbNameDataSet.xsd to access the database in the same directory as the exe file (i.e. the application using it)?
[197 byte] By [rwbogosian] at [2008-3-6]
# 1
Use Application.StartupPath to get the directory your program is in.
To get the complete filename to your mdf file, use:



string filename = System.IO.Path.Combine(Application.StartupPath, "filename.mdf");

DanielRieck at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Tools General...
# 2
Thank you but my mistake. I failed to mention it is C++ program. What you wrote appears to be VB. Tho I will add it to my VB code snippets.
rwbogosian at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Tools General...
# 3

Actually, it's C#. However, it should work with any .NET language.

DanielRieck at 2007-9-9 > top of Msdn Tech,SQL Server,SQL Server Tools General...

SQL Server

Site Classified