Hey I just started learning to make application in C# using back-end as sql.
I put some breakpoints to see that the control never comes back after executing the cntCeilInn.Open();
soon, the output window shows 'System.Data.SqlClient.SqlException
' occurred in System.Data.dll
Google tells me its not timing out or something that I couldn't understand. Some help please.
string strServerName="EXPRESSION";
using (SqlConnection cntCeilInn = new SqlConnection("Data Source=" + strServerName + ";" + "Integrated Security=YES"))
{
SqlCommand cmdCeilInn= new SqlCommand("If exists ("+ "Select name "+ "from sys.database "+ "Where name=N'CeilInn1')"+ "DROP database CeilInn1;"+ "go"+ "create database CeilInn1;", cntCeilInn);
cntCeilInn.Open();
cmdCeilInn.ExecuteNonQuery();
}