Click here to Skip to main content
15,915,094 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Including dlls in an exe Pin
kasik11-Apr-06 4:42
kasik11-Apr-06 4:42 
GeneralRe: Including dlls in an exe Pin
hertz_j11-Apr-06 8:17
hertz_j11-Apr-06 8:17 
QuestionVisula Basic 6.0 Run Time Error : 402 Pin
noshaba mariam10-Apr-06 21:29
noshaba mariam10-Apr-06 21:29 
AnswerRe: Visula Basic 6.0 Run Time Error : 402 Pin
Dave Kreskowiak11-Apr-06 13:37
mveDave Kreskowiak11-Apr-06 13:37 
GeneralRe: Visula Basic 6.0 Run Time Error : 402 Pin
noshaba mariam11-Apr-06 17:52
noshaba mariam11-Apr-06 17:52 
Questionsession problem Pin
Amit Agarrwal10-Apr-06 19:40
Amit Agarrwal10-Apr-06 19:40 
AnswerYour question is not directly related to vb.net Pin
JUNEYT11-Apr-06 11:44
JUNEYT11-Apr-06 11:44 
QuestionIn my VS2003 project I send mail and it sends 7-8 times every time I send it? Pin
kenn_rosie10-Apr-06 19:29
kenn_rosie10-Apr-06 19:29 
In my VS2003 project I send mail and it sends 7-8 times every time I send it?

I have the following code in my global.asax code, The problem is the receiver gets 7-8 copies every time i SEND IT?
Public Class Global
Inherits System.Web.HttpApplication

#Region " Component Designer Generated Code "

Public Sub New()
MyBase.New()

'This call is required by the Component Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call

End Sub

'Required by the Component Designer
Private components As System.ComponentModel.IContainer


<system.diagnostics.debuggerstepthrough()> Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
End Sub

#End Region





Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)

' Fires when the application is started

'1. Create a connection

Dim myConnection As New SqlConnection(ConfigurationSettings.AppSettings("connectionString"))

myConnection.Open()

'2. Create the command object, for the query

Const strSQL As String = "Select LastUpdated, ProductId from products "

Dim objCmd As New SqlCommand(strSQL, myConnection)

Dim objDR As SqlDataReader

Dim att

objDR = objCmd.ExecuteReader()

While (objDR.Read)

If (Not (objDR("LastUpdated") Is DBNull.Value)) Then

If (Date.Compare(objDR("LastUpdated"), Today.Date) = 0) Then

Dim newMail As New MailMessage

newMail.From = "zzzxyz@msn.com" '' this is the From Address

newMail.To = "bill@msn.com" '' this is TO Address

'newMail.Cc = "ken@dtyinc.net" '' this is TO Address

newMail.Subject = "Change in Product Rate"

newMail.Body = " Dear Ken, " & "Please review attached document for product ID: " & objDR("ProductID") & "Thank you," & "Kenn()"

att = New MailAttachment("C:\Inetpub\wwwroot\GrocerToGo\Product_Changed.doc")

newMail.Attachments.Add(att)

newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1")

newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "bill@dtyinc.net")


newMail.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "Password")



SmtpMail.SmtpServer = ""


SmtpMail.Send(newMail)

End If

End If

End While

myConnection.Close() 'Close the connection

End Sub
QuestionIn my Global asax file aDo I need the code below newmail.fields.add and why do I need them? Pin
kenn_rosie10-Apr-06 19:15
kenn_rosie10-Apr-06 19:15 
Questionit saving two records instead of one Pin
Amit Agarrwal10-Apr-06 19:12
Amit Agarrwal10-Apr-06 19:12 
GeneralRe: it saving two records instead of one Pin
Guffa10-Apr-06 22:30
Guffa10-Apr-06 22:30 
GeneralRe: it saving two records instead of one Pin
Amit Agarrwal10-Apr-06 23:19
Amit Agarrwal10-Apr-06 23:19 
GeneralRe: it saving two records instead of one Pin
Guffa11-Apr-06 1:42
Guffa11-Apr-06 1:42 
GeneralRe: it saving two records instead of one Pin
Amit Agarrwal11-Apr-06 2:15
Amit Agarrwal11-Apr-06 2:15 
AnswerRe: it saving two records instead of one Pin
Guffa11-Apr-06 3:45
Guffa11-Apr-06 3:45 
Questiondatagrid in vb.net Pin
pankajgarg1210-Apr-06 18:53
pankajgarg1210-Apr-06 18:53 
AnswerRe: datagrid in vb.net Pin
Amit Agarrwal10-Apr-06 19:14
Amit Agarrwal10-Apr-06 19:14 
Questioninterview questions Pin
pankajgarg1210-Apr-06 18:49
pankajgarg1210-Apr-06 18:49 
AnswerRe: interview questions Pin
Steve Pullan11-Apr-06 13:55
Steve Pullan11-Apr-06 13:55 
GeneralRe: interview questions Pin
Dave Kreskowiak11-Apr-06 17:26
mveDave Kreskowiak11-Apr-06 17:26 
GeneralRe: interview questions Pin
Steve Pullan11-Apr-06 17:54
Steve Pullan11-Apr-06 17:54 
QuestionHow to display selected field in crystal report Pin
sparkycodeproject10-Apr-06 16:11
sparkycodeproject10-Apr-06 16:11 
Questionvb.net modify mdb database NEED HELP! Pin
ckkc456710-Apr-06 15:49
ckkc456710-Apr-06 15:49 
AnswerRe: vb.net modify mdb database NEED HELP! Pin
Chatura Dilan10-Apr-06 17:27
Chatura Dilan10-Apr-06 17:27 
GeneralRe: vb.net modify mdb database NEED HELP! Pin
ckkc456710-Apr-06 18:59
ckkc456710-Apr-06 18:59 

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.