cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
395
Views
0
Helpful
5
Replies

Build PhoneMenu object with Database Entries

I am designing an ASP page that uses a library to generate XML phone objects. I want to dynamically create a PhoneMenu object using names retrieved from a database. However, when I open the connection to the database, the XML does not display on the phone.

Any ideas would be greatly appreciated.

Kind Regards,

Michael Smith

5 Replies 5

agiaccone
Level 1
Level 1

Paste some code snippet so that we can have a look at the part which doesn't work.

Alberto

Thank you so much for the reply! Here's a snippet of the class I'm using...

Partial Public Class _Default

Inherits System.Web.UI.Page

Dim a As New SqlClient.SqlConnection("Data Source=;Initial Catalog=PhoneTest;Integrated Security=True")

Dim _names As ArrayList

Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

a.Open()

' Note: If the above line is commented out, it works fine on the phone...

End Sub

Private Sub FillArrayList()

Dim DA As New SqlClient.SqlDataAdapter("SELECT * From Employees", a)

Dim DT As New DataTable

DA.Fill(DT)

For Each dr As DataRow In DT.Rows

-Names.Add(dr(1).ToString)

Next

DA.Dispose()

DT.Dispose()

End Sub

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

Response.ContentType = "text/xml"

' Testing PhoneText object

'Dim t As Cisco_Handler.CiscoIPPhoneServices.CiscoIPPhoneText = New CiscoIPPhoneText("IP Phone Service", "Button Configuration...", "Developed By M. Smith")

't.AddSoftKey(New Cisco_Handler.CiscoIPPhoneServices.CiscoSoftKey("Button1", "http://10.1.0.75/Page2.aspx", 1))

't.AddSoftKey(New Cisco_Handler.CiscoIPPhoneServices.CiscoSoftKey("Button2", "http://10.1.0.75/Page2.aspx", 2))

't.AddSoftKey(New Cisco_Handler.CiscoIPPhoneServices.CiscoSoftKey("Button3", "http://10.1.0.75/Page3.aspx", 3))

't.AddSoftKey(New Cisco_Handler.CiscoIPPhoneServices.CiscoSoftKey("Button4", "http://10.1.0.75/Page4.aspx", 4))

' Test PhoneInput Object -- Works Fine

'Dim t As New CiscoIPPhoneInput("Title1", "prompt", "http://test.com")

't.AddInput("Display1", Cisco_Handler.InputFlags.A)

' Testing Phone Menu

Dim t As New CiscoIPPhoneMenu("My IP Service Main Menu", "Choose Selection:")

t.AddMenuItem(_names.Item(0).ToString, "http://10.1.0.75/Page2.aspx")

t.AddMenuItem(_names.Item(0).ToString, "http://10.1.0.75/Page3.aspx")

' Send objec to phone..

Response.Write(t.ToString())

End Sub

End Class

I greatly appreciate your help,

Michael

If you try to display the output with internet explorer what do you see ?

If nothing is displayed, maybe your AddMenuItem method could have some error in formatting xml..

If I open the page in IE, it displays the properly formatted XML as it should (including the database entries as buttons) . If I were to comment out the line that reads 'a.open' everything displays correctly on the phone (except for the names being generated from the database; which comes from the following line: t.AddMenuItem(_names.Item(0).ToString, "http://10.1.0.75/Page2.aspx") )

I'm unclear why connecting to a sql server instance prevents the XML from displaying on the phone.

Any insight would be greatly appreciated.

Cheers,

Michael

I have fixed this issue myself. Thanks for the help everyone!

Cheers,

Michael

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: