This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Me.LogEntryTextBox.DataBindings.Add("Text", tblVitalSignWorkLogBindingSource, "LogEntry", True, DataSourceUpdateMode.OnPropertyChanged, vbNullString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'See https://msdn.microsoft.com/en-us/library/33y2221y(v=vs.110).aspx for more information | |
Imports System.Data.SqlClient | |
Public Class Form1 | |
'create a dataset | |
Dim AKRODataset As New DataSet("AKRODataset") | |
'set up the database connectionstring | |
Dim tblVitalSignWorkLogSqlConnection As New SqlConnection(My.Settings.ConnectionString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim str As String() = textBoxName.Text.Split(New [Char]() {CChar(vbCrLf)}) | |
For Each s As String In str | |
MsgBox(s) | |
Next |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- SS2008R2 requires counterclockwise input of vertices. This trick makes an invalid geography valid | |
DECLARE @geom GEOMETRY = 'POLYGON ((0 0, 10 0, 10 10, 0 10, 0 0))'; | |
DECLARE @geog GEOGRAPHY = @geom.MakeValid().STUnion(@geom.STStartPoint()).STAsText() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'There are a couple of ways to get a Feature's WKT | |
'1: BasicGeometry.ToString is WKT. This is the easiest way to get WKT | |
FeatureSet.Features(0).BasicGeometry.ToString 'returns the Feature's WKT | |
'2 A function that uses a WKTWriter | |
''' <summary> | |
''' Returns a Feature's WKT string equivalent | |
''' </summary> | |
''' <param name="Feature">DotSpatial Feature</param> | |
''' <returns>String</returns> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub AddWKTDataColumnToFeatureSet(Featureset As FeatureSet) | |
Try | |
'add a WKT DataColumn to the FeatureSet's DataTable | |
Dim WKTColumn As New DataColumn("WKT", Type.GetType("System.String")) | |
Featureset.DataTable.Columns.Add(WKTColumn) | |
'dim a WKT writer | |
Dim WKTWriter As New DotSpatial.Topology.Utilities.WktWriter | |
'loop through the features and build WKT strings and add them to the WKT column |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function CreateFeatureset() As FeatureSet | |
'create a featureset with four data columns | |
Dim MyFeatureset As New DotSpatial.Data.FeatureSet(FeatureType.Point) | |
With MyFeatureset | |
.Name = "Bears" | |
.Projection = DotSpatial.Projections.KnownCoordinateSystems.Geographic.World.WGS1984 | |
.DataTable.Columns.Add(New DataColumn("Waypoint", Type.GetType("System.String"))) | |
.DataTable.Columns.Add(New DataColumn("Boars", Type.GetType("System.Int32"))) | |
.DataTable.Columns.Add(New DataColumn("Sows", Type.GetType("System.Int32"))) | |
.DataTable.Columns.Add(New DataColumn("Cubs", Type.GetType("System.Int32"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'Select all the text in a TextBox automatically when clicked | |
'You would think that you want to do this with the TextBox's Enter event but SelectAll() doesn't work with that event. | |
'You have to use the MouseDown event. | |
Private Sub InputTextBox_MouseDown(sender As System.Object, e As System.Windows.Forms.MouseEventArgs) Handles InputTextBox.MouseDown | |
With Me.InputTextBox | |
.Focus() | |
.SelectAll() | |
End With | |
End Sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' <summary> | |
''' Converts a DataTable to a string of delimited values such as CSV | |
''' </summary> | |
''' <param name="DataTable">DataTable to convert. DataTable</param> | |
''' <param name="Delimiter">Values separator</param> | |
''' <returns>String</returns> | |
''' <remarks></remarks> | |
Public Function DataTableToCSV(DataTable As DataTable, Delimiter As String) As String | |
Dim CSV As String = "" | |
Try |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Dim CurrentDateTime As String = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") |