473,651 Members | 3,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Service update record method

10 New Member
Hi,
Im trying to logically figure out how to update a record in a database through a web service to the database I have created this web method function but im stuck on completing this

the database record to update is ...
- User Table
- ID
- ForeName
- SurName
- Pin Number


I am writing a method to update the pin number

I have done it like this so far...
Expand|Select|Wrap|Line Numbers
  1. <WebMethod()> _
  2.     Public Function Change_Pin_Number_Nurse(ByVal id As Integer, ByVal pin As String) As Boolean
  3.  
  4.  
  5. Dim b As Boolean // boolean to return if webmethod is successfull in operation
  6.         Dim ds As UserTableAdapters.NurseTableAdapter // the table adadpter from the dataset i want to use
  7.         Dim myds As Data.DataTable// the data table to update
  8.         Try
  9.             ds = New UserTableAdapters.NurseTableAdapter
  10.             myds = ds.Get_Nurses_by_ID(id)  // the row to update
  11.             ds.Update(myds)// returns the record 
  12.                                // enter the pin number and keep the other data as they are
  13.             b = True
  14.         Catch ex As Exception
  15.             b = False
  16.         End Try
  17.         Return b
  18.     End Function
  19.  
I hope someone could please help me Please

Thanks

Kunal
Apr 2 '09 #1
1 1704
Kunal101
10 New Member
never mind i sorted it myself thanks anyway

Kunal
Apr 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1508
by: Fritz Bosch | last post by:
We are in the process of refactoring our GUI-based test application for radio equipment and are rewriting a significant part in Python. The new architecture will substantially be based on the model-view-controller pattern, as follows: User Input | v +-------------+ service request service request +-------------+
3
15418
by: Mihaly | last post by:
I want to update a record into a table in SQL Server 2000 database from C#. This table is used concurently for other users too, and I want to be sure that from the read of record to the update no other user was updated the record. Please tell me how can I do this. Thank you!
5
2592
by: joeblast | last post by:
I have a Web service that gets the financial periods and hold a reference to a disconnected dataset built at initialization. Web methods work on the dataset inside the web service. Everything is fine so far. My problem is that when I call a web method to modify the dataset inside the Web service it is never updated and I get no errors. currentPeriods method will always give me 1 even if I call ChangeDataset and call currentPeriods...
9
3202
by: zMisc | last post by:
When I try to update record, I kept getting this error: Row cannot be located for updating. Some values may have been changed since it was last read. No other users are accessing the database - only 1 user is accessing the database. I open the data using adLockOptimistic locking.
2
75017
by: DaveN | last post by:
Hi all, I'm trying to update a record in a table with data from text boxes on a form. As a background to this, I managed to add a new record to the table in a similar manner with the following: Set db = CurrentDb Set rs = db.OpenRecordset("Project Table") rs.AddNew rs("Project_Number") = Me!
7
2631
by: David P. Donahue | last post by:
My experience with databases using C# has been pretty limited thus far. Mostly I just use a SELECT statement to populate a DataSet, which is just read-only (mostly for display on a web page), or maybe go so far as to build an UPDATE or INSERT query with a couple parameters and just execute it against the database. Currently, this is all done within a web service, which acts as a kind of protective barrier between the actual database and...
0
2199
by: Emanuele | last post by:
I have write a program using MS Visual studio C++ 7.0 (platform Windows XP professional). I'm not using .NET. This program save data in a SQL server 2000 database using ADO. Everything works correctly, yet if i stop the sql service and then restart it, while the programs write records, the reconnection to the server dont't work. When the service stops i catch all the exceptions. I want try to reconnect to the database continually till...
6
595
by: Chris Marsh | last post by:
All I have a database table, changes to the data within which I am interested in acting on. The approach that I'm taking is to have the database update a file every time data is updated. This process is outside my domain - I can rely on the file being updated when data changes. Within my domain is the design of a Windows service to perform the operations required when the data changes. I have not produced a Windows service before...
1
5409
by: Max2006 | last post by:
Hi, I am truing to find a pattern for my Business Logic Layer to be able to work fine win ObjectDataSource's Update method. The challenge is ObjectDataSource is not able to work with an update method that accepts a strongly typed data table as parameters. We have to have an update method with all data table's columns as its parameter. Like what we have here: http://asp.net/learn/data-access/tutorial-16-cs.aspx
0
8278
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8807
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8701
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8584
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7299
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5615
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4290
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.