Android Question ASP.Net Pages( Passing Parameters)

Makumbi

Well-Known Member
Licensed User
Please hep Me pass the parameter for customer
http://192.168.1.239/Webandroid/Dtdgrid.aspx?customer=1006

The page deletes the passed parameter when it loading
How can i accomplish this while using B4a
Below is my Code for the webpage
when i pass the parameter from my browse it successfully does the job how about from B4a code

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
 

Jeffrey Cameron

Well-Known Member
Licensed User
Last edited:
Upvote 0
Top