Android Question Passing Parameter to ASP.net Webpage

DonManfred

Expert
Licensed User
Longtime User
We can not answer your question without knowing how the Dtdgrid.aspx works.
Post the documentation of the WS how the service must be called.

We cannot guess it.
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
We can not answer your question without knowing how the Dtdgrid.aspx works.
Post the documentation of the WS how the service must be called.

We cannot guess it.
B4X:
Imports System.Data.SqlClient
Imports System.Configuration
Partial Class Dtdgrid
    Inherits System.Web.UI.Page

    Private Sub form1_Load(sender As Object, e As EventArgs) Handles form1.Load
        Customer.Text = Request.QueryString("customer")
        Delete(Customer.Text.ToString)
    End Sub
    Public Sub Delete(customerId As Integer)
        Dim constr As String = ConfigurationManager.ConnectionStrings("constr").ConnectionString
        Using con As New SqlConnection(constr)
            Using cmd As New SqlCommand("DELETE FROM Customers WHERE CustomerId = @CustomerId")
                cmd.Parameters.AddWithValue("@CustomerId", customerId)
                cmd.Connection = con
                con.Open()
                cmd.ExecuteNonQuery()
                con.Close()
            End Using
        End Using
    End Sub
End Class
This is my code from my web page
 
Upvote 0

Pendrush

Well-Known Member
Licensed User
Longtime User
You can try something like this:
B4X:
Dim CustID As Int = 1006 ' Customer ID
Dim j As HttpJob
j.Initialize("", Me)
j.Download("http://192.168.1.239/Webandroid/Dtdgrid.aspx?customer=" & CustID)
j.GetRequest.Timeout = 10000 ' 10 seconds
Wait For (j) JobDone(j As HttpJob)
If j.Success Then ' if job is success
   Dim RetVal As String
   RetVal = j.GetString
   Log(RetVal) ' will print in log value returned from the server
End If
j.Release
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
thank you pedrush it finaly worked may ALLAH bless you with more knowledge
Good afternoon how can i get the same code for my other page which returns data from customer as shown in the attached file because i wanted to get the customer details returned then insert them it into my SQL lite database how can i get this done. please help how to modify this code

B4X:
Dim CustID As Int = 1006 ' Customer ID
Dim j As HttpJob
j.Initialize("", Me)
j.Download("http://192.168.1.239/Webandroid/Dtdgrid.aspx?customer=" & CustID)
j.GetRequest.Timeout = 10000 ' 10 seconds
Wait For (j) JobDone(j As HttpJob)
If j.Success Then ' if job is success
   Dim RetVal As String
   RetVal = j.GetString
   Log(RetVal) ' will print in log value returned from the server
End If
j.Release
 

Attachments

  • sampleimage.jpg
    sampleimage.jpg
    62.5 KB · Views: 238
Upvote 0
Top