March 25th, 2010
Retrieving value pairs from an XML file based on an XML defined property (in this case production/test) is shown below:
Example XML file:
<?xml version=”1.0″ encoding=”utf-8″?>
<configuration>
<appSettings>
<add key=”env” value=”test” />
</appSettings>
<production>
<add key=”abc_Server” value=”produvtion” />
<add key=”abc_Port” value=”5560″ />
<add key=”abc_User” value=”abcdba” />
<add key=”abc_Password” value=”xxx” />
<add key=”abc_Version” value=”DEFAULT” />
<add key=”DBName” value=”prod” />
<add key=”DBUserName” value=”abcdba” />
<add key=”DBPassword” value=”xxx” />
</production>
<test>
<add key=”abc_Server” value=”dev_env” />
<add key=”abc_Port” value=”6169″ />
<add key=”abc_User” value=”abcdba” />
<add key=”abc_Password” value=”xxx” />
<add key=”abc_Version” value=”DEFAULT” />
<add key=”DBName” value=”dev” />
<add key=”DBUserName” value=”abcdba” />
<add key=”DBPassword” value=”xxx” />
</test>
</configuration>
Retrieve value pairs into a NameValueCollection (remember to reference System.Collections.Specialized) and reference an item:
Dim elem As XmlElement = CType(XmlDoc.SelectSingleNode(“//appSettings/add[@key='env']“), XmlElement)
Dim currentEnv As String = elem.GetAttribute(“value”)
Dim nodeList As XmlNodeList = XmlDoc.GetElementsByTagName(currentEnv)
Settings = New NameValueCollection
Dim oNode As XmlNode
Dim oKey As XmlNode
For Each oNode In nodeList
For Each oKey In oNode.ChildNodes
Settings.Add(oKey.Attributes(“key”).Value, oKey.Attributes(“value”).Value)
Next
Next
ConnectionString = “Data Source=” & appSettings(“DBName”) & “;”
Tags: Programming, XML
Posted in Programming | Comments Off
February 15th, 2010
Web based GIS , environmental, health and safety solutions and business driven web applications are just some of the exciting services that Infinite Digital Solutions offers.
For more information visit the Infinite Digital Solutions website.
Tags: GIS development, health safety and environment, web development
Posted in GIS, Programming, Software | No Comments »
January 14th, 2010
After spending numerous frustrating hours (OK maybe minutes) to get a decent example of implementing the jQuery UI date picker in ASP.NET I decide to jot it down here. First download it if you don’t have it yet here.
First you want to reference the stylesheet:
<link href="CSS/ui-lightness/jquery-ui-1.7.2.custom.css" rel="stylesheet" type="text/css" />
(I selected the ui-lightness theme when I downloaded and placed it in the CSS folder I created – this should go into the HEAD section of your aspx page)
Next you need to reference the script files (in the aspx body section):
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script src="js/ui/ui.core.js" type="text/javascript"></script>
<script src="js/ui/ui.datepicker.js" type="text/javascript"></script>
(I copied the scripts to a the js folder I created)
Now add a textbox to the page that will pop-up the calendar when selected receive the date selected, I named mine txtValue1. Also set the CssClass:
<asp:TextBox ID="txtValue1" runat="server" CssClass="ui-datepicker" Visible="true"></asp:TextBox>
Finally you need the JavaScript to pop the date picker (I added it to the top of the page in the body section after the previous script references):
<script type="text/javascript">
$(document).ready(function() {
$("#<%=txtValue1.ClientID %>").datepicker();
});
</script>
And that’s about it!
If you have hassles, make sure that the stylesheet and script files are correctly referenced.
Tags: ASP.NET, datepicker, jQuery
Posted in Programming | No Comments »
January 10th, 2010
The application has failed to start because mspdb80.dll was not found.
Search for the following files
- msobj80.dll
- mspdb80.dll
- mspdbcore.dll
- mspdbsrv.exe
They are usually under C:\Program Files\Microsoft Visual Studio 8\Common7\IDE. Copy the file and paste it to the folder containing “cl.exe” (usually C:\Program Files\Microsoft Visual Studio 8\Vc\bin)
Tags: DLL
Posted in Programming | 1 Comment »
January 10th, 2010
This is how my MapServer .NET development experience began. Searching the internet for a solution inevitably leads you back to the “you’re missing a dependency” and “compile the dll yourself”. Not exactly the simple solution I was hoping for.
Alas after trying in vain to compile MapServer myself and endless hours scouring the internet I found the source! The latest compiled builds for MapServer and the MapScript libraries can be found here: http://vbkto.dyndns.org:1280/sdk/Default.aspx
Be sure to use the DLLs from the same build when writing applications using MapScript. It is very easy to get lost in DLL Hell with all the different versions being used by MapServer over time.
In the following weeks I will write about some of my experiences developing an ASP.NET web application using C# and MapScript.
Tags: C#, MapScript, MapServer
Posted in DLL Hell, GIS, MapServer, Programming | No Comments »