Click here to Skip to main content
15,913,027 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 9:24
satc7-Feb-16 9:24 
GeneralRe: Make application's forms independent from Screen resolution Pin
Eddy Vluggen7-Feb-16 9:40
professionalEddy Vluggen7-Feb-16 9:40 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc7-Feb-16 8:54
satc7-Feb-16 8:54 
SuggestionRe: Make application's forms independent from Screen resolution Pin
Richard Deeming8-Feb-16 2:20
mveRichard Deeming8-Feb-16 2:20 
GeneralRe: Make application's forms independent from Screen resolution Pin
satc9-Feb-16 5:24
satc9-Feb-16 5:24 
QuestionDatagridview date sort - Tons of examples online, no answers Pin
Dan Chapin5-Feb-16 3:09
Dan Chapin5-Feb-16 3:09 
AnswerRe: Datagridview date sort - Tons of examples online, no answers Pin
Dave Kreskowiak5-Feb-16 4:09
mveDave Kreskowiak5-Feb-16 4:09 
AnswerRe: Datagridview date sort - Tons of examples online, no answers Pin
Richard Deeming5-Feb-16 4:24
mveRichard Deeming5-Feb-16 4:24 
Unfortunately, there's no easy way to do this, because your dates are not in the standard XML date/time format[^], and your XML doesn't include a schema.

You'll need to read the XML into a temporary table, and then manually copy the rows to a table with the correct data types for the columns.

Something like this should work:
VB.NET
Dim dsTemp As New DataSet()
dsTemp.ReadXml(myXMLTime)

Dim dsTime As DataSet = dsTemp.Clone()
Dim table As DataTable = dsTime.Tables(0)

Dim startTimeColumn As DataColumn = table.Columns("Start_Time")
Dim stopTimeColumn As DataColumn = table.Columns("Stop_Time")

startTimeColumn.DataType = GetType(DateTime)
stopTimeColumn.DataType = GetType(DateTime)

Dim formatProvider As IFormatProvider = System.Globalization.CultureInfo.InvariantCulture

For Each row As DataRow in dsTemp.Tables(0).Rows
    Dim values As Object() = row.ItemArray
    
    Dim time As String = DirectCast(values(startTimeColumn.Ordinal), String)
    values(startTimeColumn.Ordinal) = DateTime.Parse(time, formatProvider)
    
    time = DirectCast(values(stopTimeColumn.Ordinal), String)
    values(stopTimeColumn.Ordinal) = DateTime.Parse(time, formatProvider)
    
    table.Rows.Add(values)
Next

DataGridView2.DataSource = dsTime
DataGridView2.DataMember = "Ticket"

DataGridView2.Sort(DataGridView2.Columns(startTimeColumn.Ordinal), System.ComponentModel.ListSortDirection.Descending)




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionHow to set textbox readonly from Selected value from Combobox Pin
Reginald_13-Feb-16 2:14
Reginald_13-Feb-16 2:14 
AnswerRe: How to set textbox readonly from Selected value from Combobox Pin
Dave Kreskowiak3-Feb-16 2:45
mveDave Kreskowiak3-Feb-16 2:45 
GeneralRe: How to set textbox readonly from Selected value from Combobox Pin
Reginald_19-Feb-16 7:54
Reginald_19-Feb-16 7:54 
GeneralRe: How to set textbox readonly from Selected value from Combobox Pin
Dave Kreskowiak9-Feb-16 8:31
mveDave Kreskowiak9-Feb-16 8:31 
AnswerRe: How to set textbox readonly from Selected value from Combobox Pin
ZurdoDev9-Feb-16 8:15
professionalZurdoDev9-Feb-16 8:15 
Questionvb Pin
Member 123040962-Feb-16 18:34
Member 123040962-Feb-16 18:34 
GeneralRe: vb Pin
PIEBALDconsult2-Feb-16 18:34
mvePIEBALDconsult2-Feb-16 18:34 
SuggestionRe: vb Pin
Richard MacCutchan2-Feb-16 22:11
mveRichard MacCutchan2-Feb-16 22:11 
GeneralRe: vb Pin
Sascha Lefèvre2-Feb-16 22:54
professionalSascha Lefèvre2-Feb-16 22:54 
QuestionRe: vb Pin
CHill604-Feb-16 4:01
mveCHill604-Feb-16 4:01 
GeneralRe: vb Pin
Sascha Lefèvre4-Feb-16 4:12
professionalSascha Lefèvre4-Feb-16 4:12 
AnswerRe: vb Pin
ZurdoDev9-Feb-16 8:16
professionalZurdoDev9-Feb-16 8:16 
Questionneed an urgent helpfor making graph and the values for those plotting graph to be taken from my excel files. Pin
Member 122569872-Feb-16 3:20
Member 122569872-Feb-16 3:20 
AnswerRe: need an urgent helpfor making graph and the values for those plotting graph to be taken from my excel files. Pin
Sascha Lefèvre2-Feb-16 4:07
professionalSascha Lefèvre2-Feb-16 4:07 
QuestionVB.Net AddHandler from inside an Event Pin
Member 1229351629-Jan-16 14:51
Member 1229351629-Jan-16 14:51 
AnswerRe: VB.Net AddHandler from inside an Event Pin
Dave Kreskowiak1-Feb-16 3:41
mveDave Kreskowiak1-Feb-16 3:41 
QuestionVS2015 - MsFlexgrid not displaying when building form Pin
Denis Oxon28-Jan-16 14:33
Denis Oxon28-Jan-16 14:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.