O'Reilly logo

Programming Windows® Services with Microsoft® Visual Basic® 2008 by Michael Gernaey

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Updating the FileWorker Class

To make the additions useful, we have to update the FileWorker class to read and insert the records into our Tutorials database.

Updating <FileWorker.ProcessFiles>

We need to create an instance of our LINQSQL class and then use the file that we found while polling our process folder to populate a new user record for each line in the process file. To do this we will update the <ProcessFiles> method, which is where we query the outgoing folder, send an e-mail, and then move the file to our processed folder. Example 7-6 shows the changes required for <ProcessFiles>.

Example 7-6. FileWorker updated ProcessFiles method to support the LINQSQL class implementation.

Private Sub ProcessFiles()
  Dim LinqSql As LINQSQL = New LINQSQL() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required