With Microsoft Visual Studo. net Beta release, due to Visual Studio. net supports XML and Web services, and uses Visual Studio.. Net Web service applications will become more and more convenient. This document uses a B2B e-commerce website as an example to describe how to use web services to share the same database among different sites. In this article, the client is the party that uses the web Service, and the server is the other party that provides the web service.
Question proposal
This website is an e-commerce website (referred to as A) engaged in online sales of mobile phone SIM cards. Not long ago, the website cooperated with another website (B) to jointly sell Unicom mobile phone SIM cards online. Because the number resources of website A are all used and the database of website A is accessed, I developed an online card sales system for another website using webservice technology.
Modules and key code of Main Functions
1. The database uses SQL SERVER2000 and stored procedures to display the number browsing page. The Code is as follows:
Create procedure fenye
(
@ Pagenow int,
@ Pagesize int,
@ Cityid int,
@ Code char (3 ),
@ Recordcount int output
)
As
Set nocount on
Declare @ allid int, @ beginid int, @ endid int, @ pagebegin char (11), @ pageend char (11)
Select @ allid = count (*) from jinan where cityid = @ cityid and (code like @ code + '% ')
Select @ recordcount = @ allid
Declare cur_fastread cursor scroll
SELECT code FROM jinan where cityid = @ cityid and (code like @ code + '%') order by code
Open cur_fastread
Select @ beginid = (@ pagenow-1) * @ pagesize + 1
Select @ endid = @ beginid + @ pagesize-1
Fetch absolute @ beginid from cur_fastread into @ pagebegin
If @ endid> @ allid
Fetch last from cur_fastread into @ pageend
Else
Fetch absolute @ endid from cur_fastread into @ pageend