R
Ron
I have this code on one of my forms, the code takes whatever is in
textboxes and adds it to a MS Access Database. It then shows a
message that the operation was completed.
Is there a universal command or code to send an email to the email
entered in txtemail.text
How would I do something like that?
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim conn As New OleDbConnection("Provider=Microsoft.jet.oledb.
4.0;" & _
"Data Source=helpdesk.mdb")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into
help(Name, Email, telephone, description) Values ('{0}', '{1}', '{2}',
'{3}')", txtName.Text, txtEmail.Text, txtTelephone.Text,
txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
MessageBox.Show("Record added to database and email sent.")
Me.Close()
frmMain.Show()
End Sub
End Class
textboxes and adds it to a MS Access Database. It then shows a
message that the operation was completed.
Is there a universal command or code to send an email to the email
entered in txtemail.text
How would I do something like that?
Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnAdd.Click
Dim conn As New OleDbConnection("Provider=Microsoft.jet.oledb.
4.0;" & _
"Data Source=helpdesk.mdb")
Using (conn)
conn.Open()
Dim com As OleDbCommand = conn.CreateCommand()
Using (com)
com.CommandType = CommandType.Text
com.CommandText = String.Format("Insert Into
help(Name, Email, telephone, description) Values ('{0}', '{1}', '{2}',
'{3}')", txtName.Text, txtEmail.Text, txtTelephone.Text,
txtDescription.Text)
com.ExecuteNonQuery()
End Using
End Using
MessageBox.Show("Record added to database and email sent.")
Me.Close()
frmMain.Show()
End Sub
End Class