I have created a mdf database from visual studio 2013 and stored some informations in the table.
My problem is I can`t connect to my local database and select informations from table. This is my code for connect:
string con = "Data Source=intrebari.mdf;Integrated Security=True;";
string queryString = "Select * FROM dbo.intrebari"; //update as you feel fit of course for insert/update etc
using (SqlConnection connection = new SqlConnection(con))
{
connection.Open();
SqlDataAdapter adapter = new SqlDataAdapter();
SqlCommand command = new SqlCommand(queryString, connection);
command.ExecuteNonQuery();
data = new DataSet();
adapter.Fill(data);
MessageBox.Show(data.ToString());
connection.Close();
}
And the error:
A network-related or instance-specific error occurred while establishing a connection to SQL Server.
I already unblocked 1433 port with firewall but no succes. Here is a print to my visual studio work.