Files
DPM_PADM/DPM2016 - Kopie (2)/Database/IntTables.vb
2023-12-29 07:39:01 +01:00

41 lines
1.2 KiB
VB.net

Module IntTables
Public Inttables As New DataSet
Public orte As New DataTable
Dim Ortsverzeichnis As New DataTable
Public Function GetOrt(ByVal plz As String) As String
If orte.Rows.Count = 0 Then
Dim db As New clsDB
db.Get_Tabledata("Orte")
orte = db.dsDaten.Tables(0).Copy
db.Dispose()
End If
Dim ort As String = ""
For Each r As DataRow In orte.Rows
If r("plz").ToString = plz Then
ort = r("ort")
Exit For
End If
Next
Return ort
End Function
Public Function Get_Ort_Kantton(ByRef plz As String, ByRef ort As TextBox, ByRef kanton As ComboBox)
Try
Dim db As New clsDB
db.Get_Tabledata("Ortsverzeichnis", "where plz=" + plz.ToString, "", "", False)
Ortsverzeichnis = db.dsDaten.Tables(0).Copy
If Ortsverzeichnis.Rows.Count > 0 Then
ort.Text = Ortsverzeichnis.Rows(0).Item("Ort")
kanton.Text = Ortsverzeichnis.Rows(0).Item("KT")
End If
Catch
End Try
End Function
End Module