0

I almost finished my program, it runs fine on my computer. However when I try it on virtual machine (Win7) I'm getting error, Here's a screenshot:

UPDATE 2:

Screenshot

UPDATE 1: Here's full error output: https://gist.github.com/nikel/1356be52475e4515707638ed97402790

And this error:

Object reference not set to an instance of an object

I defined attachdbfilename like this:

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?

onurcano
  • 395
  • 2
  • 18

1 Answers1

1

I'm not sure what the correct answer is but I imagine the problem is your virtual machine does not have some dependency that your application expects.

Please take a look at How do I connect to an MDF database file?

Do you have SQL Server Express on your Windows 7 virtual machine?

mcny
  • 11
  • 4
  • hmm let me try installing sql server again – onurcano Mar 12 '17 at 00:06
  • Can you try to upload your error output again? https://gist.github.com/nikel/7cf254...aed24d9ee43483 leads to 404 because it looks like there is a `...` in the URL – mcny Mar 12 '17 at 00:08
  • I'm sorry, I edited the question. Just tried installing localdb sql but still the same. – onurcano Mar 12 '17 at 00:15