Click here to Skip to main content
15,890,282 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionretrive field value into combobox Pin
vijay24825-Feb-09 2:42
vijay24825-Feb-09 2:42 
AnswerRe: retrive field value into combobox Pin
Rupesh Kumar Swami5-Feb-09 3:11
Rupesh Kumar Swami5-Feb-09 3:11 
Question[Message Deleted] Pin
εїзεїзεїз5-Feb-09 2:07
εїзεїзεїз5-Feb-09 2:07 
AnswerRe: Grid View Control Pin
Henry Minute5-Feb-09 9:16
Henry Minute5-Feb-09 9:16 
QuestionWhere to put try / catch blocks when dealing with classes Pin
maxnuggets5-Feb-09 0:55
maxnuggets5-Feb-09 0:55 
AnswerRe: Where to put try / catch blocks when dealing with classes Pin
Johan Hakkesteegt5-Feb-09 2:09
Johan Hakkesteegt5-Feb-09 2:09 
GeneralRe: Where to put try / catch blocks when dealing with classes Pin
maxnuggets5-Feb-09 2:22
maxnuggets5-Feb-09 2:22 
GeneralRe: Where to put try / catch blocks when dealing with classes Pin
Johan Hakkesteegt5-Feb-09 3:04
Johan Hakkesteegt5-Feb-09 3:04 
Once you get a bit more accustomed to vb.net, you'll find that a lot of your old vb6 code is very cumbersome compared to its .net equivalent.

This is the log writing error handling sub that I use in one of my larger applications:
Public Sub EC(ByVal Err As Exception)
	Try
		Dim SW As New System.IO.StreamWriter("C:\error_log.txt", True)
		SW.WriteLine(Err.ToString)
		SW.Close()
	Catch ex As Exception
		appLog.WriteEntry(ex.ToString, EventLogEntryType.Error)
	End Try
End Sub

Although ofcourse your class may contain less lines of code, I don't know...

If you have the use of an exchange server, you can even send yourself (or others) emails:
Public Shared Function ManualMail(ByVal oFrom As String, ByVal oSubject As String, ByVal oTo As String, ByVal oText As String, Optional ByVal oCC As String = "", Optional ByVal oBCC As String = "", Optional ByVal oAttachment As Object = Nothing) As Boolean
    Dim mailmsg As New System.Web.Mail.MailMessage
    With mailmsg
        .BodyFormat = MailFormat.Html
        .From = oFrom
        .To = oTo
        If Not oCC = "" Then .Cc = oCC
        If Not oBCC = "" Then .Bcc = oBCC
        .Subject = oSubject
        .Body = oText
        If Not oAttachment = Nothing Then .Attachments.Add(oAttachment)
    End With
    Try
        System.Web.Mail.SmtpMail.SmtpServer = SmtpServerAddressHere 'example: mail.domain.com
        System.Web.Mail.SmtpMail.Send(mailmsg)
        Return True
    Catch ex As Exception
        appLog.WriteEntry(ex.ToString, EventLogEntryType.Error)
        Return False
    End Try
End Function

This one I actually also use in a class library.

My advice is free, and you may get what you paid for.

AnswerRe: Where to put try / catch blocks when dealing with classes Pin
riced5-Feb-09 4:43
riced5-Feb-09 4:43 
GeneralRe: Where to put try / catch blocks when dealing with classes Pin
supercat95-Feb-09 6:28
supercat95-Feb-09 6:28 
QuestionModifying a window service Pin
sohaib_a4-Feb-09 22:58
sohaib_a4-Feb-09 22:58 
AnswerRe: Modifying a window service Pin
Dave Kreskowiak5-Feb-09 2:23
mveDave Kreskowiak5-Feb-09 2:23 
Questionvb express list box Pin
steve moorley4-Feb-09 22:49
steve moorley4-Feb-09 22:49 
AnswerRe: vb express list box Pin
Rupesh Kumar Swami4-Feb-09 22:57
Rupesh Kumar Swami4-Feb-09 22:57 
Questioncompiling what was compiled before Pin
Member 42169604-Feb-09 22:36
Member 42169604-Feb-09 22:36 
AnswerRe: compiling what was compiled before Pin
Alan N5-Feb-09 0:25
Alan N5-Feb-09 0:25 
GeneralRe: compiling what was compiled before Pin
Member 42169605-Feb-09 0:40
Member 42169605-Feb-09 0:40 
GeneralRe: compiling what was compiled before Pin
Dave Kreskowiak5-Feb-09 2:20
mveDave Kreskowiak5-Feb-09 2:20 
GeneralRe: compiling what was compiled before Pin
Member 42169605-Feb-09 4:58
Member 42169605-Feb-09 4:58 
GeneralRe: compiling what was compiled before Pin
Dave Kreskowiak5-Feb-09 5:31
mveDave Kreskowiak5-Feb-09 5:31 
GeneralRe: compiling what was compiled before Pin
EliottA5-Feb-09 6:06
EliottA5-Feb-09 6:06 
GeneralRe: compiling what was compiled before Pin
Member 42169605-Feb-09 20:52
Member 42169605-Feb-09 20:52 
GeneralRe: compiling what was compiled before Pin
Dave Kreskowiak6-Feb-09 14:17
mveDave Kreskowiak6-Feb-09 14:17 
GeneralRe: compiling what was compiled before Pin
Member 42169607-Feb-09 0:29
Member 42169607-Feb-09 0:29 
AnswerRe: compiling what was compiled before Pin
Jay Royall5-Feb-09 0:30
Jay Royall5-Feb-09 0:30 

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.