Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Dim customerPageURL As String = "http://localhost:7047/DynamicsNAV/WS/CRONUS International Ltd/Page/Customer"
Dim customerService As New CustomerPageRef.Customer_Service()
customerService.Url = customerPageURL
customerService.UseDefaultCredentials = True
Dim customer10000 As CustomerPageRef.Customer = customerService.Read("10000")
Response.Write(vbCrLf + "Name of Customer 10000: " + customer10000.Name + "<Br>")
Dim filter1 As New CustomerPageRef.Customer_Filter()
Dim filter2 As New CustomerPageRef.Customer_Filter()
Dim filters() As CustomerPageRef.Customer_Filter = New CustomerPageRef.Customer_Filter(1) {filter1, filter2}
Dim customers() As CustomerPageRef.Customer = customerService.ReadMultiple(filters, Nothing, 0)
For Each customer As CustomerPageRef.Customer In customers
Response.Write("Customer Name : " & customer.Name + "<BR> ")
Next
End Sub
Dim filter1 As New CustomerPageRef.Customer_Filter()
Dim filter2 As New CustomerPageRef.Customer_Filter()
Dim filters() As CustomerPageRef.Customer_Filter = New CustomerPageRef.Customer_Filter(1) {filter1, filter2}
Dim customers() As CustomerPageRef.Customer = customerService.ReadMultiple(filters, Nothing, 0)
For Each customer As CustomerPageRef.Customer In customers
Response.Write("Customer Name : " & customer.Name + "<BR> ")
Next
Dim Dt As New System.Data.DataTable()
Dim Dc As New System.Data.DataColumn()
Dc.DataType = System.Type.GetType("System.string")
Dc.ColumnName = "Name"
Dt.Columns.Add(Dc)
For Each customer As CustomerPageRef.Customer In customers
Dim Dr As System.Data.DataRow = Dt.NewRow()
Dr("Name") = customer.Name
Dt.Rows.Add(Dr)
Next
Dim GridView1 As New GridView()
GridView1.DataSource = Dt
GridView1.DataBlind()
Page.Form.Controls.Add(GridView1)
Dim Dt As New System.Data.DataTable()
Dim Dc As New System.Data.DataColumn()
Dc.DataType = System.Type.GetType("System.string")
Dc.ColumnName = "Name"
Dt.Columns.Add(Dc)
For Each customer As CustomerPageRef.Customer In customers
Dim Dr As System.Data.DataRow = Dt.NewRow()
Dr("Name") = customer.Name
Dr("Field1") = customer.Field1
Dr("Field2") = customer.Field2
Dr("Field3") = customer.Field3
Dt.Rows.Add(Dr)
Next
Dim GridView1 As New GridView()
GridView1.DataSource = Dt
GridView1.DataBlind()
Page.Form.Controls.Add(GridView1)