summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2008-12-17 11:12:51 -0800
committerAndrew <andrewarnott@gmail.com>2008-12-18 08:19:32 -0800
commit4db1de9b26b4ab456efb728a56359960c7654901 (patch)
tree8e610e6ecb9941975d184c587abcb8f36f24c35b
parentdcade1d70d0aab7414fc861b63b44b4d1411e4a7 (diff)
downloadDotNetOpenAuth-4db1de9b26b4ab456efb728a56359960c7654901.zip
DotNetOpenAuth-4db1de9b26b4ab456efb728a56359960c7654901.tar.gz
DotNetOpenAuth-4db1de9b26b4ab456efb728a56359960c7654901.tar.bz2
Fixed sample database creation when App_Data directory is missing.
-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()) {