Generate odd number to be added as parameter into sql statement vb.net -
i working in vb.net windows form applications sql end. trying use loop write odd numbers sql column starting 1 , moving amount of rows in datagridview. however, statement not giving me next step , depending on loop placements either miss loop write rows sql database or miss odd number. here code: cn integer = 0 datagridview1.rowcount - 1 dim starttime date = datagridview1.rows(cn).cells(1).value integer = 1 cn 'sql code try using conn1 new sqlconnection(connstring) conn1.open() using comm1 new sqlcommand("insert table1 (col1, col2, col3, col4, col5) values (@col1, @col2, getdate(), 5, @col5)", conn1) comm1.parameters .addwithvalue("@col1", starttime) .addwithvalue("@col2", combobox1.selectedvalue) .addwithvalue("@col5", i) ...