ASP.Net Process/How do I pull this off Question

evad4682

Well-known member
Joined
Nov 7, 2005
Messages
55
Programming Experience
Beginner
Hello,

I need some ideas on how to accomplish this task that I have taken on. I need a way to run a vb.net application on a local pc from an internal webpage and then return the results of that locally ran application to the very same webpage it was launched from. If that is unclear maybe this will help:

1) User clicks a button on a webpage
2) Through some magic my vb.net application is launched and executed locally:confused: <- My .net app is trusted and can be ran from a share but I am still having all kinds of problems here.
3) Upon vb.net app completion, a bunch is written to my SQL database
4) The same webpage queries SQL database and returns results

I would like to take advantage of the AJAX Update panel control to eliminate a complete page postback due to the large amount of other frap that will allready be present. Can an update panel execute a vb.net app then simply do a database query and return resluts? If so, how do I set this up? If there is a better way to do this I am all ears.

Thanks in advance
 
Last edited:

evad4682

Well-known member
Joined
Nov 7, 2005
Messages
55
Programming Experience
Beginner
Ok got it

1) create a server side click event for a button
2) create a process object
3) run process
4) wait for process to complete
5) query database for process results

VB.NET:
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
         Dim p As System.Diagnostics.Process = New System.Diagnostics.Process
        p.StartInfo.FileName = "\\server\share\test.exe"
        p.Start()
        p.WaitForExit()

        Dim q As String = "SELECT * FROM whatever WHERE something"
        Dim dr As SqlDataReader
        Dim cmd As New SqlCommand
        Dim cn As SqlConnection = New SqlConnection("connection string")
        cmd.CommandType = Data.CommandType.Text
        cmd.CommandText = q
        cmd.Connection = cn
        cn.Open()
        dr = cmd.ExecuteReader
        If dr.HasRows Then
            While dr.Read
                Label2.Text = dr("column")
                Label2.ForeColor = Drawing.Color.Green
            End While
        End If
        cn.close


    End Sub

To use the update panel I just put button one inside of the update panel and presto!
 
Top Bottom