h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Get DataBase Exists or not using DataContext

   This is code for Get DataBase Exists or not using DataContext

DataContext context = new DataContext(GetConnectionString("YourSErverName"));
bool dbExists = context.DatabaseExists();
 if (dbExists)
{
MessageBox.Show("Database Exists");
 }
 else
 {
 MessageBox.Show("Database doesn't Exist");
}
 static string GetConnectionString(string serverName)
 {
 System.Data.SqlClient.SqlConnectionStringBuilder builder = new System.Data.SqlClient.SqlConnectionStringBuilder();
 builder["Data Source"] = serverName; builder["integrated Security"] = true;
 builder["Initial Catalog"] = "Sample2"; Console.WriteLine(builder.ConnectionString); Console.ReadKey(true); return builder.ConnectionString;
 }

Base Directory vs Current Directory

 Base Directory vs Current Directory
S.No Base Directory Current Directory
1returns the path where the executable file exists.returns the path that the current working directory from the executable file.