diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2008-12-17 11:12:51 -0800 |
---|---|---|
committer | Andrew <andrewarnott@gmail.com> | 2008-12-18 08:19:32 -0800 |
commit | 4db1de9b26b4ab456efb728a56359960c7654901 (patch) | |
tree | 8e610e6ecb9941975d184c587abcb8f36f24c35b | |
parent | dcade1d70d0aab7414fc861b63b44b4d1411e4a7 (diff) | |
download | DotNetOpenAuth-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.aspx | 5 |
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()) { |