Click here to Skip to main content
15,895,084 members
Articles / Database Development / SQL Server

Web Based Job Scheduler

Rate me:
Please Sign up or sign in to vote.
3.65/5 (24 votes)
11 May 2007LGPL32 min read 150.2K   4K   118  
A complete VB.NET application to schedule DOS command tasks online
Imports System.Data.OleDb

Public Class Helper

    Friend Sub ExecuteSql(ByVal sSql As String)
        Dim cn As New OleDb.OleDbConnection(GetConnectionString())
        cn.Open()
        Dim cm As New OleDb.OleDbCommand(sSql, cn)
        cm.ExecuteNonQuery()
        cn.Close()
    End Sub

    Friend Function ExecuteScalar(ByVal sSql As String) As String
        Dim cn As New OleDb.OleDbConnection(GetConnectionString())
        cn.Open()
        Dim cm As New OleDb.OleDbCommand(sSql, cn)
        Dim sRet As String = cm.ExecuteScalar()
        cn.Close()
        Return sRet
    End Function

    Friend Function GetDataReader(ByVal sSql As String) As OleDb.OleDbDataReader
        Dim cn As New OleDb.OleDbConnection(GetConnectionString())
        cn.Open()
        Dim cm As New OleDb.OleDbCommand(sSql, cn)
        Return cm.ExecuteReader(CommandBehavior.CloseConnection)
    End Function

    Private Function GetConnectionString() As String
        Dim sFilePath As String = System.AppDomain.CurrentDomain.BaseDirectory() & "connect.udl"
		Return "File Name = " & sFilePath
    End Function

    Function PadQuotes(ByVal s As String) As String
        Return System.Text.RegularExpressions.Regex.Replace(s, "'", "''")
    End Function

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Web Developer
United States United States
Igor is a business intelligence consultant working in Tampa, Florida. He has a BS in Finance from University of South Carolina and Masters in Information Management System from University of South Florida. He also has following professional certifications: MCSD, MCDBA, MCAD.

Comments and Discussions