summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--samples/ServiceProvider/Default.aspx5
1 files changed, 4 insertions, 1 deletions
diff --git a/samples/ServiceProvider/Default.aspx b/samples/ServiceProvider/Default.aspx
index a84c8b2..eafafba 100644
--- a/samples/ServiceProvider/Default.aspx
+++ b/samples/ServiceProvider/Default.aspx
@@ -6,7 +6,10 @@
<script runat="server">
protected void createDatabaseButton_Click(object sender, EventArgs e) {
- string dbPath = Path.Combine(Server.MapPath(Request.ApplicationPath), "App_Data");
+ string dbPath = Path.Combine(Server.MapPath(Request.ApplicationPath), "App_Data");
+ if (!Directory.Exists(dbPath)) {
+ Directory.CreateDirectory(dbPath);
+ }
string connectionString = ConfigurationManager.ConnectionStrings["DatabaseConnectionString"].ConnectionString.Replace("|DataDirectory|", dbPath);
var dc = new DataClassesDataContext(connectionString);
if (dc.DatabaseExists()) {