I am trying to make a sample in a book work
this is the SQL statement in the Data Adapater
SELECT DOC_ID, DOC_Cust_ID, DOC_Doc_Type, DOC_DIC_ID, DOC_Status_Date
FROM dbo.Document
WHERE (DOC_ID = @DOCID)
I get this error when testing:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
If I rem out all these lines
daDocuments.SelectCommand.Parameters("@Docid").Value = Doc_ID
'daDocuments.Fill(DsDocuments1)
'If DsDocuments1.Document.Count > 0 Then
'Return CStr(DsDocuments1.Document(0).Item("DOC_Cust_ID"))
'Else
'Return "Can't Find It !!!!"
'End If
to just have this
return "12345"
it works OK
My datasource is on another server
I can view the data in the Server Explorer just fine
TIA
DougP, MCP, A+
Code:
Imports System.Web.Services
<System.Web.Services.WebService( _
Description:="Document Retreval", _
Namespace:="[URL unfurl="true"]http://tempuri.org/DocumentWEBServ")>[/URL] _
Public Class ReturnDocInfo
Inherits System.Web.Services.WebService
<WebMethod(Description:="Returns Documents")> _
Public Function GetDoc(ByVal Doc_ID As String) As String
daDocuments.SelectCommand.Parameters("@Docid").Value = Doc_ID
daDocuments.Fill(DsDocuments1)
If DsDocuments1.Document.Count > 0 Then
Return CStr(DsDocuments1.Document(0).Item("DOC_Cust_ID"))
Else
Return "Can't Find It !!!!"
End If
End Function
SELECT DOC_ID, DOC_Cust_ID, DOC_Doc_Type, DOC_DIC_ID, DOC_Status_Date
FROM dbo.Document
WHERE (DOC_ID = @DOCID)
I get this error when testing:
The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.
If I rem out all these lines
daDocuments.SelectCommand.Parameters("@Docid").Value = Doc_ID
'daDocuments.Fill(DsDocuments1)
'If DsDocuments1.Document.Count > 0 Then
'Return CStr(DsDocuments1.Document(0).Item("DOC_Cust_ID"))
'Else
'Return "Can't Find It !!!!"
'End If
to just have this
return "12345"
it works OK
My datasource is on another server
I can view the data in the Server Explorer just fine
TIA
DougP, MCP, A+