Dov_B
asked on
after I publish my application and run it it cannot find my database file
when I test it from the code that application connects to the database with :
constring = "Data Source=" & My.Application.Info.Direct oryPath & "\Database1.sdf;Persist Security Info=False;"
but when I publish it and try to run the published version I get an error and it says to check the path
constring = "Data Source=" & My.Application.Info.Direct
but when I publish it and try to run the published version I get an error and it says to check the path
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
may you be blessed thankyou thankyou thankyou
it was set as auto I changed it to included and then it worked by the way why was that necessary
it was set as auto I changed it to included and then it worked by the way why was that necessary
You have to tell the publish process that you will use that. and that will be published.
Example, you sometimes work with local SQL databases but then when you deploy your application the database is running on the server. You don't need to include that on your project! If you really want you have to tell that.
Example, you sometimes work with local SQL databases but then when you deploy your application the database is running on the server. You don't need to include that on your project! If you really want you have to tell that.
Second, try Application.StartupPath instead of My.Application.Info.Direct
If nothing of this works, please post the complete code of the exception thrown.