I am currently developing a mobile application based on Windows CE for my team to track out assets and store them in our existing database.
I am able to develop and deploy the software successfully however I can't seem to connect to my SQL Server 2012 database from Visual Studio 2008. When I try to connect from Visual Studio 2017, it works just fine.
This is my test code only not my real asset tracker code so it wont have the UI I built for the asset tracker app.
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
namespace test_smart_device
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
button1.Click += new EventHandler(button_connect);
}
private void button_connect(object sender, EventArgs e)
{
string connetionString = null;
SqlConnection cnn ;
connetionString = "Data Source=172.16.206.20;Initial Catalog=IBusinessTest;Integrated Security=SSPI;User ID=username;Password=123456";
cnn = new SqlConnection(connetionString);
try
{
cnn.Open();
MessageBox.Show ("Connection Open ! ");
cnn.Close();
}
catch (Exception ex)
{
MessageBox.Show("Can not open connection ! ");
}
}
}
}
When I try to connect to my database, I get this error:
This is from the debugger when I put the breakpoint at the catch statement