' must include: Imports System.Web.HttpContext
Dim DS As New DataSet()
Dim FilePath As String
''AspEnableParentPaths = True
'FilePath = Server.MapPath("~/App_Data/tlkpCodeValues.xml")
FilePath = Current.Server.MapPath("App_Data\tlkpCodeValues.xml")
DS.ReadXml(FilePath)
Dim I As Integer
strddl.Items.Clear()
' Display the result
For I = 0 To DS.Tables(0).Rows.Count - 1
If DS.Tables(0).Rows(I).Item("CodeType") = strObjParm Then
Dim newListItem As New ListItem
newListItem.Value = DS.Tables(0).Rows(I).Item("Code_Val")
newListItem.Text = DS.Tables(0).Rows(I).Item("ShortDescText")
strddl.Items.Add(newListItem)
End If
Next
strddl.Items.Insert(0, New ListItem("--Choose One--"))
Imports System.IO
Private Sub CopyFiles(ByVal sSource As String, ByVal sDestination As
String, Optional ByVal sExtension As String = "*.csv", Optional ByVal
blnOverWrite As Boolean = False)
If Directory.Exists(sSource) = False Then
MessageBox.Show("Source directory doesn't exist", "Source
Directory Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
If Directory.Exists(sDestination) = False Then
MessageBox.Show("Destination directory doesn't exist",
"Destination Directory Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
Exit Sub
End If
Dim fil As FileInfo
Dim diSourceDir As New DirectoryInfo(sSource)
Try
For Each fil In diSourceDir.GetFiles(sExtension)
fil.CopyTo(Path.Combine(sDestination, fil.Name), blnOverWrite)
Next
Catch ex As Exception
' Probably read only
End Try
End Sub
Public Function GetGeoCoords(ByVal inString As String) As String
Dim Chunks As String()
Dim outString As String = ""
Chunks = Regex.Split(inString, "&")
For Each s As String In Chunks
If InStr(s, "ll") > 0 Then outString = s
Next
Return Replace(Replace(outString, "sll=", ""), "ll=", "")
End Function
Private Sub ObjectDataSource1_Selected(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs) Handles ObjectDataSource1.Selected
Dim numRows As Integer = (e.ReturnValue).Tables(0).Rows.Count
End Sub