This question is similar to
http://p2p.wrox.com/archive/aspx/2002-01/94.asp, but I didn't see an answer. Just question/answer over and over again.
I am trying to compile this and I am getting an error that System.Data and System.Data.OleDb cannot be found. I even re-installed .NET SDK, but it is giving me the same error.
BTW, This is not complete - I just got to a point I wanted to test. Also, I know that Application variable reference is going to give me a problem. Is there a specific class I shoud import for that? Probably a System.Web class?
<code>
Imports System.Data
Imports System.Data.OleDb
Namespace JobTracker
Public Class JobNumbers
'returns last job number from either database or application variable
Private Function GetLastJobNumber(ByVal strSource As String) As Integer
If strSource = "db" Then
Dim objConn As New OleDbConnection(ConfigurationSettings.AppSettings( "strConn" ))
objConn.Open()
Dim strSQL As String = "Select Last_Job_Number From Admin_Params"
Dim objComm As New OleDbCommand(strSQL, objConn)
Dim dr As OleDbDataReader = objComm.ExecuteReader(CommandBehavior.CloseConnect ion)
If dr.Read() Then
Return CInt(dr.Item("Last_Job_Number" ))
End If
Else
Return CInt(Application("Last_Job_Number" ))
End If
End Function
End Class
End Namespace
</code>