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
'Loop through the rows | |
Private Sub DumpGridEXTable(GridEX As GridEX) | |
For Each Row As GridEXRow In GridEX.GetRows | |
Debug.Print("GroupValue: " & Row.GroupValue) | |
For i As Integer = 0 To Row.Cells.Count - 1 | |
Debug.Print(vbTab & Row.Cells(i).Column.Caption & " " & Row.Cells(i).Value) | |
Next | |
Next | |
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
'root table | |
Private Sub CampaignsGridEX_SelectionChanged(sender As Object, e As EventArgs) Handles CampaignsGridEX.SelectionChanged | |
Me.TblVitalSignWorkLogGridEX.RootTable.Columns("LogDate").DefaultValue = Now | |
End Sub | |
'heierarchical tables | |
Private Sub CampaignsGridEX_SelectionChanged(sender As Object, e As EventArgs) Handles CampaignsGridEX.SelectionChanged | |
Me.CampaignsGridEX.Tables("Campaigns").Columns("RecordInsertedDate").DefaultValue = Now | |
Me.CampaignsGridEX.Tables("Campaigns").Columns("RecordInsertedBy").DefaultValue = My.User.Name | |
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
'load the herd column dropdown | |
With Me.CampaignsGridEX.RootTable.Columns("Herd") | |
.HasValueList = True | |
.LimitToList = True | |
End With | |
Dim HerdList As GridEXValueListItemCollection = Me.CampaignsGridEX.RootTable.Columns("Herd").ValueList | |
HerdList.Add("Chisana", "Chisana") | |
HerdList.Add("Mentasta", "Mentasta") |
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 MyDataTable As New DataTable | |
With MyDataTable | |
.Columns.Add("Name", GetType(String)) | |
.Columns.Add("Age", GetType(Integer)) | |
.Rows.Add("Sketr", 24) | |
.Rows.Add("Big Guy", 8) | |
End With | |
For Each Row As DataRow In MyDataTable.Rows | |
Debug.Print(Row.Item("Name") & Row.Item("Age")) | |
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
Private Sub LoadWorkLogNetworkIDComboBox() | |
'get a reference to the datagridview's combobox column | |
Dim NetworkIDCombobox As DataGridViewComboBoxColumn = Me.TblNetworkWorkLogDataGridView.Columns("WorkLog_NetworkIDComboBox") | |
'set the combobox's datapropertyname to the corresponding column in its bindingsource. this bindingsource was set up using the form's tools, not in code | |
With NetworkIDCombobox | |
'bind the combobox to the NetworkID column of the work log bindingsource's datatable | |
.DataPropertyName = "NetworkID" | |
'load the combobox options from a database query |
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
'Use this tip if you have a .Net DataSet with two or more tables that have a master-detail relationship and you want to show the master data in a DataGridview and the related detail records in another DataGridview. | |
'This tip assumes you've used the DataSet Wizard and have that all set up. The master DataGridView is easy to set up, just point it to the Dataset and Table you want. To get the detail DataGridView to synchronize with the master you need to set the underlying table's BindingSource's DataSource property to the foreign key relationship of the master table's BindingSource. |
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
Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load | |
If Request.Params("CampaignID") = Nothing Then | |
'There is no record to edit, set the form to Insert mode | |
Me.DetailsView1.DefaultMode = DetailsViewMode.Insert | |
Else | |
'User requested a Campaign record to view | |
Me.DetailsView1.DefaultMode = DetailsViewMode.ReadOnly | |
End If | |
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> | |
''' Returns a DataTable from a database query defined by a ConnectionString. | |
''' </summary> | |
''' <param name="ConnectionString">ConnectionString to a database</param> | |
''' <param name="Sql">An SQL query</param> | |
''' <returns>DataTable</returns> | |
Private Function GetDataTable(ConnectionString As String, Sql As String) As DataTable | |
'the DataTable to return | |
Dim MyDataTable As New DataTable |
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
'https://msdn.microsoft.com/en-us/library/b22t666e(v=vs.110).aspx | |
Private Sub dataGridView1_DefaultValuesNeeded(ByVal sender As Object, _ | |
ByVal e As System.Windows.Forms.DataGridViewRowEventArgs) _ | |
Handles dataGridView1.DefaultValuesNeeded | |
With e.Row | |
.Cells("Region").Value = "WA" | |
.Cells("City").Value = "Redmond" | |
.Cells("PostalCode").Value = "98052-6399" | |
.Cells("Country").Value = "USA" |
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
git config --global http.sslCAInfo "C:\PathToCertificate.crt" |