Monday, 15 September 2014

VB.NET MYSQL Multiple Queries -



VB.NET MYSQL Multiple Queries -

i have vb.net desktop app uses mysql. can connect remotely without problem. have timer command query database every 10 secs. want execute multiple functions without using multiple connections.

class="lang-vb prettyprint-override">private sub timer__tick()... phone call get_queued_emails phone call function2 phone call function3 end sub

sample function:

class="lang-vb prettyprint-override">public function get_queued_emails(byval sql string) seek ' load db globalfunctions.db_connect() dim reader new mysqldatareader dim command mysqlcommand = connection.createcommand() command.commandtext = sql reader = command.executereader if (reader.hasrows) while (reader.read()) message_id = reader(0).tostring message_status = reader(2).tostring exit while end while reader.close() globalfunctions.connection.close() phone call function here.... else reader.close() globalfunctions.connection.close() end if end if grab ex exception messagebox.show("error" & ex.message) end seek end sub'

mysql vb.net

No comments:

Post a Comment