mysql - DataAdapter Missing Record -
we execute mysql statement data reader (7 records) vb.net load datatable (newly created 6 records?) via code below - first record seem abscond when datatable becomes involved - cannot fathom why - ur wisdom appreciated.
sql = "select count(total) 'inv #', concat(date_format(date, '%m'), '/', date_format(date, '%y')) month, sum(total) 'total' (tblinvoices) group date_format(date, '%m%y') order month desc" try mycommand.connection = mysqlconn mycommand.commandtext = sql myadapter.selectcommand = mycommand mydata = mycommand.executereader() mydata.read() <- perfect 7 records catch ex mysqlexception msgbox(ex.number & ", " & ex.message) dim myinvoiced new datatable myinvoiced.load(mydata) <- 6 records???
try without line.
mydata.read() it positioning @ second record.
Comments
Post a Comment