Hello everyone,
I've been trying to return a dataset from a webservice to a client app on pocket pc emulator. The webservice works fine when i run it on the local host but when i try accessing it on Internet Explorer i get the following error when i hit the invoke button:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
at Microsoft.VisualBasic.Interaction.MsgBox(Object Prompt, MsgBoxStyle Buttons, Object Title)
at Service.ReturnData()
Below is the code for the webservice:
Can anyone help me out??
Thanks
I've been trying to return a dataset from a webservice to a client app on pocket pc emulator. The webservice works fine when i run it on the local host but when i try accessing it on Internet Explorer i get the following error when i hit the invoke button:
System.InvalidOperationException: Showing a modal dialog box or form when the application is not running in UserInteractive mode is not a valid operation. Specify the ServiceNotification or DefaultDesktopOnly style to display a notification from a service application.
at System.Windows.Forms.MessageBox.ShowCore(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options, Boolean showHelp)
at System.Windows.Forms.MessageBox.Show(IWin32Window owner, String text, String caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defaultButton, MessageBoxOptions options)
at Microsoft.VisualBasic.Interaction.MsgBox(Object Prompt, MsgBoxStyle Buttons, Object Title)
at Service.ReturnData()
Below is the code for the webservice:
Code:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.Data
Imports System.Data.SqlClient
<WebService(Namespace:="[URL unfurl="true"]http://tempuri.org/")>[/URL] _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Service
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function ReturnData() As DataSet
Dim sqlconnection1 As New SqlConnection
Dim SqlCmd As New SqlClient.SqlCommand
Dim SqlDA As New SqlClient.SqlDataAdapter
Dim DS As New DataSet
Dim DB_ServerName As String
Dim DB_Catalog As String
Dim DB_password As String
Dim DB_userID As String
'Dim DB_Packet As String
'Dim DB_PersistSec As String
Dim workstationid As String
Dim ConnectionString As String = ""
Try
DB_ServerName = GetSetting("TMC", "EMRUserManagementSettings", "datasource")
DB_Catalog = GetSetting("TMC", "EMRUserManagementSettings", "intcat")
DB_userID = GetSetting("TMC", "EMRUserManagementSettings", "user")
DB_password = GetSetting("TMC", "EMRUserManagementSettings", "passwrd")
workstationid = Environment.MachineName
ConnectionString = "workstation id=" & workstationid & ";user id=" & DB_userID & ";data source=" & DB_ServerName & ";initial catalog=" & DB_Catalog & ";password=" & DB_password
SqlCmd = sqlconnection1.CreateCommand
SqlCmd.CommandType = CommandType.StoredProcedure
SqlCmd.CommandText = "PDAtest"
SqlDA.SelectCommand = SqlCmd
If sqlconnection1.State <> ConnectionState.Open Then
sqlconnection1.ConnectionString = ConnectionString
sqlconnection1.Open()
End If
SqlCmd.ExecuteNonQuery()
SqlDA.SelectCommand = SqlCmd
SqlDA.Fill(DS, "PatientProfile")
Return DS
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Function
End Class
Can anyone help me out??
Thanks