使用B4a android编程传递参数

时间:2018-10-30 10:06:01

标签: android asp.net vb.net basic4android

请帮助我为客户传递参数 http://192.168.1.239/Webandroid/Dtdgrid.aspx?customer=1006

页面在加载时删除传递的参数。 如何在使用B4a android时完成此操作? 以下是我的ASP.NET网页代码。 当我从浏览器传递参数时,它成功完成了这项工作。从B4a代码怎么样?

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

0 个答案:

没有答案