1
Answer

Using external web services. Can anybody help? (Different to my other thread)

Dan

Dan

17y
2.3k
1
Hi guys,

PLEASE NOTE THIS IS A DIFFERENT PROBLEM TO MY OTHER WEB SERVICES POST...

I have been able to create my own asp.net web page that accesses my own web service by creating a web reference from a service in the current solution.

I have been trying to access an external web service, one that is freely available on webservicex.net however I create the web reference as usual but then it does not work in the same way as in the solution that I created one locally.

Can anybody offer a tutorial that takes you through step-by-step how to use a web service that is freely available online?
Answers (1)
0
CHAITANYA KIRAN KASANI
NA 206 86.2k 12y
I Had Changed Update statement as u said "Update Customer Set Name='@name,Address='@address'. but it is showing an OleDbException "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again. " The Update statement that i had written is correct only but, i think some other statement should write to update all the records at a time..i am in search of that only...Any Way ThanQ for Your Suggestion
0
Shivanand Arur
NA 4.9k 745.3k 12y
Hey Chaitanya, You have written you update query like this
"update customer set Name1=@name,Address=@address where Name1=@name";"

What this will do is, it will update the name and the address of the customer according to the specific name of the Customer.

For example...
table name: tblCustomer

Columns:
CustID        CustName        CustAddress
01                Shiv                Mumbai
02                Anand                Delhi
03                Chaitanya        Kolkata

Now If I write a query which you have written in the Code....
"update customer set Name1=@name,Address=@address where Name1=@name";

Suppose in the @name parameter i get the value as 'Anand', in the @address parameter i get the value as 'Pune' and again for the @name parameter in the where clause i get the value as 'Anand'.... So logically your query will look something like this...
"Update Customer Set Name1='Anand', Address='Pune' where Name1='Anand';"

It means that you are updating a record where the Name1 is 'Anand', hence it is just recording only one record... If you wanna update all the records, then simply put this Update Query as mentioned below...

"
Update Customer Set Name='@name', Address='@address' " what this will do is that it will update all the members with the name and the address value that you have passed in the parameter.....

General knowledge - Usually you should always update a record based on the ID (Primary key) of the table.... it is much safe since it will affect only a specific record.... If you pass a name or an address in the where clause, it will affect all the records which have the same name and the address in the database table..


Please let me know, if this solution is pro[er.... and is possible please explain the functionality if the answered post is incorrect....

Thank you!!!