ASP.NET woes ...
-
This is starting to confuse me and I think (?) this is a good place to post this problem. I am building a rather small and simple application so I have chosen to use an Access database for starting off. I like how simple things can be to make a web app with the Design View when making a ASP.NET application ... I think it handles most things pretty decently ... except I am stuck as to how to get the connection to the Access database in the Design view. I use the Server Explorer and connect to the Access DB with no problem. I drag the DB from the Server Explorer into my page and it creates a connection. Everything appears to be playing along nicely so far ... However, there is a problem. This application is going to reside on some other web server and I will need to do the old ASP trick of Server.MapPath() in the connection string. This is the beginning of my frustration. Since the connection string needs to be dynamically created (to get the absolute path to the DB) I cannot slap a static connection string as a key in the web.config file. Since the code behind likes to do its own thing in its "Web Form Designer generated code" segment in order to initialize connections and handle events I cannot go and try to change the connection string in there. I have tried to modify it and when it finds the change it simply takes out the connection string initialization completely. Any suggestions on a way to get around this?
Wally Atkins
Newport News, VA, USA