-
Database Edit Update Error
I am creating an ASP.NET website that has a multitier application that uses a WCF Service that allows for database updating (Contacts.mdf). I have been working my way through step-by-step instructions. GetContacts, DeleteContact, and InsertContact work. UpdateContacts does not.
The error message that I am getting is:
ObjectDataSource 'ObjectDataSource1' could not find a non-generic method 'UpdateContacts' that has parameters: Name, CompanyName, Address, City, State, Zip, Telephone, Fax, Original_PubID, PubID
Code I am using:
Code:
in IContactsService:
<OperationContract()> _
Function UpdateContacts(ByVal Name As String, _
ByVal CompanyName As String, _
ByVal Address As String, ByVal City As String, _
ByVal State As String, ByVal Zip As String, _
ByVal Telephone As String, ByVal Fax As String, _
ByVal Original_PubID As Integer) As Integer
in ContactsService:
Code:
Public Function UpdateContacts(ByVal Name As String, _
ByVal CompanyName As String, _
ByVal Address As String, ByVal City As String, _
ByVal State As String, ByVal Zip As String, _
ByVal Telephone As String, ByVal Fax As String, ByVal Original_PubID As Integer) As Integer _
Implements IContactsService.UpdateContacts
' Update the dataset.
Try
Dim ContactsTableAdapter As New _
ContactsDataSetTableAdapters.PublishersTableAdapter
ContactsTableAdapter.Update(Name, CompanyName, Address, _
City, State, Zip, Telephone, Fax, Original_PubID)
Catch ex As Exception
Throw ex
End Try
End Function
I have set the ReadOnly property of PubID to false in the DataSet Designer and also using the smart tag of the DetailsView control -- Edit Fields.
The code is straight out of a textbook, so I don't think it is that? A problem with the parameters Original_PubID, PubID that the service is looking for I think, but how to fix it? Suggestions please? TIA!
-
I got this to work by using Pub_ID in the 3 places in the code where I had used Original_PubID before. I was concerned since Pub_ID had ReadOnly set to False, that perhaps if the user tried to change it in the update procedure, that it would throw an error. It did not. It left the Pub_ID as it was. So, all is good, except I'm not sure why the code didn't work as written in the textbook?
Similar Threads
-
By garywillams in forum C++
Replies: 2
Last Post: 05-14-2009, 09:22 AM
-
By hendrikbez in forum .NET
Replies: 5
Last Post: 04-02-2009, 03:43 PM
-
By Gill in forum Database
Replies: 1
Last Post: 08-19-2003, 12:12 PM
-
By Brandon Burch in forum VB Classic
Replies: 3
Last Post: 05-10-2002, 07:09 AM
-
By Dan in forum VB Classic
Replies: 0
Last Post: 03-17-2000, 05:14 AM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks