This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Howdy All, I'm having some difficulty getting a proper context. In my new app I went in and copied the app.config sections over from a GOOD Working App. In the New app, I used the same type of declaration for the context, but in the NEW app, it is NOT pulling any of the context attributes over from the app.config file. Here is my app.config file:
And here is the line for my context declaration:
However, when I get to the part where I want to change the NamingStategy for my context via code, if I look at the context via the watch window or "hover" over it... it DOES NOT have the correct dataprovider, or connection string or anything else... in fact it looks like some sort of default setup with SQLServer as the dataprivder... The Model is correctly connected to the database (In Oracle_). as i can see and place the tables in it just fine. OK so I'm slightly confused as to why to difference in behavior... Hopefully this is something simple!!! Thanks in advance, Kevin Orcutt GIS Developer/Consultant City of Cincinnati - Cincinnati Area GIS (CAGIS) (513) 850-1335 (cell) Kevin.Orcutt@cincinnati-oh.gov www.cagis.org |
|
|
OK so my app.config didn't properly paste into my message: I'll try again....
|
|
|
OK so my app.config didn't properly paste into my message: I'll try again....
|
|
|
Try number 2!!! here I think is a image of the app.config file... |
|
|
Hi Kevin, The config file itself looks fine but from the behavior you have described it would sound like the context section is not being found in the app.config, possibly because the running process is not using the configuration file you are expecting. If you build the app and then go to the /bin/debug folder, you should see the executable and then executable.config. If you open up the .config file this should match what was in your app.config. Can you confirm that this is the case.
|
|
|
Hey Jeremy, I think you're correct about the app.config problem... I'll throw another monkey wrench into this... I forgot to mention that this project is an "extension" to ESRI ArcMap product, i.e. I'm essentially building a .dll for ArcMap to use. therefore, it really doesn't have an "app.config". I forgot about that when I first posted my original problem... So now, my problem moves to: How do I go about creating a Context programmatically? What all do i need to setup via methods and properties to get my context up and running??? I understand the advantages of using a "app.config" for this normally, but i think in this particular case, that might not be an option. Thanks again in advance, Kevin Orcutt |
|
|
Here is an example of creating a context programmatically:
You can assign any other properties as required, they will be pretty discoverable as they are named the same as the attribute names in the configuration based context definition :)
|
|