Skip to content

Instantly share code, notes, and snippets.

View dannylloyd's full-sized avatar

Danny Lloyd dannylloyd

  • University of Arkansas for Medical Sciences
  • Cabot, Arkansas
View GitHub Profile
@dannylloyd
dannylloyd / Check All Checkboxes.js
Last active September 27, 2015 11:18
Selects all checkboxes in a asp.net gridview
var gridView = '#<%= gridViewId.ClientID%>';
var checkAll = '#checkBoxId';
$(checkAll).click(function (i, v) {
$('input[type=checkbox]', gridView).prop('checked', this.checked);
});
var checkCount = $('input[type=checkbox]', gridView).length;
$('input[type=checkbox]', gridView).click(function (i, v) {
$(checkAll).prop('checked', $('input:checked', gridView).length == checkCount);
@dannylloyd
dannylloyd / Delimited file Reader.vb
Last active March 23, 2016 18:14
Read delimited text file in vb.net
Using var reader As New TextFieldParser("C:\Users\Danny\Desktop\New Text Document.txt")
reader.HasFieldsEnclosedInQuotes = True
reader.SetDelimiters(New String() {","})
While(Not reader.EndOfData)
Try
Console.WriteLine(reader.LineNumber)
Dim fields As String() = reader.ReadFields()
For Each value As String In fields
Console.WriteLine(value)
Next