|
-
Mar 11th, 2017, 05:50 AM
#1
Thread Starter
Addicted Member
Error when running my app on another machine
Hello, I finished my program, it runs fine on my computer. However when I try it on virtual machine (Win7) I'm getting error something like: Invalid value for attachDbfilename. Here's a screenshot:

Here's full error output: https://gist.github.com/nikel/7cf254...aed24d9ee43483
I defined attachdbfilename like this:
VB.NET Code:
private void Form1_Load(object sender, EventArgs e)
{
SqlConnectionStringBuilder builder = new SqlConnectionStringBuilder();
builder.DataSource = @"(LocalDB)\MSSQLLocalDB";
builder.AttachDBFilename = @"|DataDirectory|\database\gazi_db.mdf";
builder.IntegratedSecurity = true;
builder.ConnectTimeout = 30;
sqlConnection = new SqlConnection(builder.ConnectionString);
...
How can I fix this?
-
Mar 12th, 2017, 05:05 PM
#2
Re: Error when running my app on another machine
How did you deploy the app? XCOPY, ClickOnce or something else? Regardless of the how, the error message clearly indicates that there is no file named 'gari_db.mdf' in the 'database' subfolder of your data directory. What you need to do about it depends on the how.
-
Mar 12th, 2017, 05:58 PM
#3
Thread Starter
Addicted Member
Re: Error when running my app on another machine
Hello, I don't have any built in setups. I just want to zip "Release" (if required "Debug") folder and run on anther machine. Because these machines don't have internet connection. I've heard XCOPY for the first time, need to search about it.
I have mdf files both in exe and and exe\database directories. In fact I don't know where to put them.
I created database from gui, if it makes sense.
One more thing, do I have to set server name?
Thank you for your reply.
-
Mar 12th, 2017, 06:23 PM
#4
Thread Starter
Addicted Member
Re: Error when running my app on another machine
I installed Windows 7 English and sql localdb. Now I'm getting another error:

https://gist.github.com/nikel/fabb0a...d33fcab0f8ee0c
and this: Object reference not set to an instance of an object
(like the previous one)
-
Mar 12th, 2017, 09:54 PM
#5
Re: Error when running my app on another machine
If the error message says that it couldn't find the server and/or instance specified then that's what happened. If it was me, when an error log told me that the instance I expected to be there wasn't there, I'd look to see what instances there were there.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|