Hy,
I am using SQL Server 2012 under MS Visual Studio 2012.
Below is my connection string from app.config
<add key="Platform" value="Data Source=Bigfoot2;Initial Catalog=Platform;Integrated Security=True"/>
and my connection class
static SqlConnection con;
public static SqlConnection GetConnection()
{
con = new SqlConnection(ConfigurationManager.AppSettings["Platform"].ToString());
return con;
}
internal void AddCustomer (Buyer customer, User user, PlatformType type )
{
SqlConnection conn = DALConnection.GetConnection();
try
{
SqlCommand cmd = new SqlCommand("InsertCustomer", conn);
cmd.CommandType = CommandType.StoredProcedure;
...
con.Open();
cmd.ExecuteNonQuery();
My database is stored under my project folder.
The error I get when I try to use my method is:
Could not open a connection to SQL Server 2012
Sincerely,