Click here to Skip to main content
15,895,283 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionDatagridview default style getting changed changes Pin
nishkarsh_k30-Jan-08 20:36
nishkarsh_k30-Jan-08 20:36 
GeneralRe: Datagridview default style getting changed changes Pin
Dave Kreskowiak31-Jan-08 4:46
mveDave Kreskowiak31-Jan-08 4:46 
GeneralRe: Datagridview default style getting changed changes Pin
nishkarsh_k31-Jan-08 19:48
nishkarsh_k31-Jan-08 19:48 
GeneralLock Folder Pin
Kumaran21cen30-Jan-08 19:43
Kumaran21cen30-Jan-08 19:43 
GeneralRe: Lock Folder Pin
Mycroft Holmes30-Jan-08 22:00
professionalMycroft Holmes30-Jan-08 22:00 
GeneralRe: Lock Folder Pin
Steven J Jowett30-Jan-08 23:28
Steven J Jowett30-Jan-08 23:28 
GeneralRe: Lock Folder Pin
Dave Kreskowiak31-Jan-08 4:45
mveDave Kreskowiak31-Jan-08 4:45 
Generalinstantiating object returns nothing Pin
rotsey30-Jan-08 18:01
rotsey30-Jan-08 18:01 
Hi,

I have this code. Which is the beginning of class. The last line
objSI = new TBRSendDocInfo
has an error when this code
executes objSI is nothing.

What would cause a object not be able to instantiate it???

The object TBRSendDocInfo definition is below this code.



<transaction(transactionoption.requiresnew)> Public Class TransTimesheetWeekly
Inherits ServicedComponent

Public objSI As TBRSendDocInfo

Private CapType As String

Private CapID As Integer

Private justTimesheet As Boolean

Private SickDefault As Date = "01/01/1980"

Private HolidayDefault As Date = "01/01/1981"

Private LWOPDefault As Date = "01/01/1982"

Private Const WorkedDefault As String = "01/01/1984"

Private Const NotWorkedDefault As String = "01/01/1985"

Public Function ProcessTimesheetWeekly(ByVal tswID As Integer) As Integer

objSD = clsServiceDefaults.Load("C:\Windows\TBRServices.xml", GetType(clsServiceDefaults))

Connstr = objSD.TBRConnCap

WebConnstr = objSD.TBRWebConnCap

gTestEmail = objSD.TestEmailCap

Dim objCI As New tblCapturedInvoices(mdsDatabaseV3.mdsDbType.dbSQL)

Dim objTW As New tblwebTimesheetWeekly(mdsDatabaseV3.mdsDbType.dbSQL)

Dim objDB As New mdsDatabaseV3.cMDSTableData(Connstr, mdsDatabaseV3.mdsDbType.dbSQL)

Dim objWDB As New mdsDatabaseV3.cMDSTableData(WebConnstr, mdsDatabaseV3.mdsDbType.dbSQL)

Dim objDR As SqlClient.SqlDataReader

Dim objPR As SqlClient.SqlDataReader

Dim SQL, s As String

Dim i, j, wk, newID, wksInv As Integer

Dim objR As DataRow

Dim submitted As Date

Try

objSI = New TBRSendDocInfo

etc

etc











Imports System.Xml.Serialization

Imports System.IO

Public Class PDFDocInfo

Public InputFile As String

Public DocType As String

Public OutputFile As String

End Class

Public Class TBRSendDocInfo

Public ID As Integer

Public FirstName As String

Public LastName As String

Public Email As String

Public RecipientName As String

Public Subject As String

Public Body As String

Public LesterUser As String

Public FromEmail As String

<xmlignore()> Public PDFDocs As New ArrayList

Public Sub AddPDFDocInfo(ByVal pdfinfo As PDFDocInfo)

PDFDocs.Add(pdfinfo)

End Sub

Public Function AddNewPDFDocInfo() As PDFDocInfo

Dim newPDFDocInfo As New PDFDocInfo

PDFDocs.Add(newPDFDocInfo)

Return newPDFDocInfo

End Function

Public Property SendPDFDocs() As PDFDocInfo()

Get

Dim numPDFDocs As Integer

If PDFDocs.Count = 0 Then

numPDFDocs = 0

Else

numPDFDocs = PDFDocs.Count - 1

End If

Dim PDFDocInfoArray(numPDFDocs) As PDFDocInfo

PDFDocs.CopyTo(PDFDocInfoArray)

Return PDFDocInfoArray

End Get

Set(ByVal Value As PDFDocInfo())

PDFDocs.Clear()

If Not Value Is Nothing Then

Dim PDFDocInfo As PDFDocInfo

For Each PDFDocInfo In Value

PDFDocs.Add(PDFDocInfo)

Next

End If

End Set

End Property

Public Function Save(ByVal filename As String)

Dim tempFilename As String

tempFilename = filename & ".tmp"

Dim tempFileInfo As New FileInfo(tempFilename)

If tempFileInfo.Exists = True Then tempFileInfo.Delete()

Dim stream As New FileStream(tempFilename, FileMode.Create)

Try

Save(stream)

stream.Close()

tempFileInfo.CopyTo(filename, True)

tempFileInfo.Delete()

Catch ex As Exception

MsgBox("Error on Save of file " & filename & ". " & vbCrLf & ex.Message)

End Try

End Function

Public Function Save(ByVal stream As Stream)

Dim serializer As New XmlSerializer(Me.GetType)

serializer.Serialize(stream, Me)

End Function

Public Shared Function Load(ByVal filename As String, ByVal newType As Type) As Object

Dim fileInfo As New FileInfo(filename)

If fileInfo.Exists = False Then

Return System.Activator.CreateInstance(newType)

End If

Dim stream As New FileStream(filename, FileMode.Open)

Dim newObject As Object = Load(stream, newType)

stream.Close()

Return newObject

End Function

Public Shared Function Load(ByVal stream As Stream, ByVal newType As Type) As Object

Dim serializer As New XmlSerializer(newType)

Dim newObject As Object = serializer.Deserialize(stream)

Return newObject

End Function



End Class
GeneralRe: instantiating object returns nothing Pin
Justin Perez31-Jan-08 3:08
Justin Perez31-Jan-08 3:08 
QuestionHow to use Adodc In Vb.net Pin
ejaz_pk30-Jan-08 8:02
ejaz_pk30-Jan-08 8:02 
GeneralRe: How to use Adodc In Vb.net Pin
Mycroft Holmes30-Jan-08 13:18
professionalMycroft Holmes30-Jan-08 13:18 
QuestionRe: How to use Adodc In Vb.net Pin
ejaz_pk31-Jan-08 1:29
ejaz_pk31-Jan-08 1:29 
GeneralRe: How to use Adodc In Vb.net Pin
Mycroft Holmes31-Jan-08 13:12
professionalMycroft Holmes31-Jan-08 13:12 
GeneralRe: How to use Adodc In Vb.net Pin
Paul Conrad30-Jan-08 15:57
professionalPaul Conrad30-Jan-08 15:57 
QuestionInvoke Pin
Agbaria Ahmad30-Jan-08 7:15
Agbaria Ahmad30-Jan-08 7:15 
GeneralRe: Invoke Pin
Paul Conrad30-Jan-08 15:58
professionalPaul Conrad30-Jan-08 15:58 
QuestionPLZ DataGrid???? Pin
cheikhanio30-Jan-08 6:27
cheikhanio30-Jan-08 6:27 
AnswerRe: PLZ DataGrid???? Pin
Mycroft Holmes30-Jan-08 13:27
professionalMycroft Holmes30-Jan-08 13:27 
AnswerRe: PLZ DataGrid???? Pin
Paul Conrad30-Jan-08 15:59
professionalPaul Conrad30-Jan-08 15:59 
GeneralError – 3085 DAO. Database – Undefined function ‘DSUM’ in expression [modified] Pin
CCG330-Jan-08 5:11
CCG330-Jan-08 5:11 
GeneralRe: Error – 3085 DOA. Database – Undefined function ‘DSUM’ in expression Pin
Mycroft Holmes30-Jan-08 13:32
professionalMycroft Holmes30-Jan-08 13:32 
GeneralRe: Error – 3085 DOA. Database – Undefined function ‘DSUM’ in expression Pin
CCG331-Jan-08 3:18
CCG331-Jan-08 3:18 
GeneralRe: Error – 3085 DOA. Database – Undefined function ‘DSUM’ in expression Pin
Dave Kreskowiak31-Jan-08 4:42
mveDave Kreskowiak31-Jan-08 4:42 
GeneralRe: Error – 3085 DOA. Database – Undefined function ‘DSUM’ in expression Pin
CCG331-Jan-08 9:21
CCG331-Jan-08 9:21 
GeneralRe: Error – 3085 DOA. Database – Undefined function ‘DSUM’ in expression Pin
Mycroft Holmes31-Jan-08 13:09
professionalMycroft Holmes31-Jan-08 13:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.