Click here to Skip to main content
16,016,263 members

Comments by sohail awr (Top 21 by date)

sohail awr 4-Apr-14 12:43pm View    
Private Sub DataGridView1_RowStateChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowStateChangedEventArgs) Handles DataGridView1.RowStateChanged
If Me.DataGridView1.Rows.Count > 0 Then
If Me.DataGridView1.SelectedRows.Count > 0 Then
Me.TextBox2.Text = e.Row.Index
End If
End If
End Sub
sohail awr 25-Mar-14 14:04pm View    
You can use 2 timers 1st will check the IsConnectionAvailable() and 2nd will send the mails.

In your function IsConnectionAvailable()

Use condition

If IsConnectionAvailable() = True then
Timer2.Start()
else
Timer2.Stop()
End if

On Timer1 Tick event

Call IsConnectionAvailable()

On Timer2 Tick Event

Call Sendmail()

Also remember the Timer interval you should define in timer properties not on page load event.
sohail awr 25-Mar-14 11:32am View    
Your above PDF file "AOTD_SU_20131118_006.pdf" should placed there
sohail awr 25-Mar-14 11:16am View    
Normally for INT Column return value will be 0 but if you want to send null value for INT Column use this method.

oCom.CommandText = "Update emp_attendance set Present_Absent = " & IIf(Me.DataGridView1.Item(1, i).Value = "", "Null", Me.DataGridView1.Item(1, 0).Value) & " where emp_id=2"
sohail awr 25-Mar-14 9:03am View    
have you created the folder named "PDFs" in your solution. Because I have displayed the pdf through above code.