How to highlight certain criteria and perform an action upon this happening

I am new to and have to create a system that records marks of a test, the system has to detect when the marks of the test fall below standard and then recalls the details of the person using their id number and fills them into an email form, this details include the name and id number.  The system then is supposed to send the email to the supervisor, I am unable to do this web based due to the visual studio web environment not working correctly.  It has to send the email through MAPI to outlook and then take it from there.  I cannot even send it using SMTP because the SMTP on the server has been blocked.

I have not used before or connected to a database to carry out any of these actions.  If any help or examples could be provided it would be very much appreciated.

Any suggestions or help would be of great benefit to me.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sample code using VB.Net and Ado.Net:

1) You have to Import
Imports System.Data.SqlClient

2) Example uses three text boxes one for input and next two for results

3)also two buttons(one selectbutton and updateButton to your form.)

Select button event pulls information from employee table--northwind database for the typed forst name

Update button event updates the last name and homephone for the firstname.

 Private Sub selectButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles selectButton.Click
        'Clear the result textboxes
        TextBox2.Text = ""
        TextBox3.Text = ""

        'build sql connection string at run time
        Dim connect As New SqlConnection("Initial Catalog = Northwind;Data Source=(local); User ID=sa; password =test;")

        'open the connection

        'build sql string
        Dim sqlString As String
        sqlString = "Select LastName, HomePhone From Employees Where FirstName = '" & TextBox1.Text & "'"

        'open sql command object
        Dim command As New SqlCommand(sqlString, connect)

        'open sql data reader
        Dim reader As SqlDataReader = command.ExecuteReader(CommandBehavior.CloseConnection)

        ' retrieve results through data reader
        If reader.Read() Then

            TextBox2.Text = reader("LastName")
            TextBox3.Text = reader("HomePhone")

        End If

        'clean up code
        connect = Nothing

    End Sub

Private Sub UpdateButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpdateButton.Click

        'build sql connection string at run time
        Dim connect As New SqlConnection("Initial Catalog = Northwind;Data Source=(local); User ID=sa; password =test;")

        'Opns the SQL Connection

        'open command object(takes two parameters sqlstring, connection)
        Dim command As New SqlCommand("Update Employees Set LastName = '" & TextBox2.Text & "'," _
                         & " HomePhone = '" & TextBox3.Text & "' where FirstName = '" & TextBox1.Text & "'", connect)

        'execute command object

        'clean up code
        connect = Nothing

    End Sub

Hope it help.



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.