Call the. net class library referenced by webservice in the sqlserver Environment

Source: Internet
Author: User
Welcome to the Windows community forum and interact with 3 million technical staff to enter the latest project, involving system integration. SSO single-point login has been solved, but the next difficulty is the synchronization of basic data in the two systems. The project details are as follows: System AB uses the BS SYSTEM OF THE SQLSERVER2005 database. Data of system

Welcome to the Windows community forum and interact with 3 million technical staff> enter the latest project, involving system integration. SSO single-point login has been solved, but the next difficulty is the synchronization of basic data in the two systems. The project details are as follows: System AB uses the B/S system of SQLSERVER 2005 database. Data of system

Welcome to the Windows community forum and interact with 3 million technicians>

A recent project involves system integration. SSO single-point login has been solved, but the next difficulty is the synchronization of basic data in the two systems. The project details are as follows:

System AB uses the B/S system of SQLSERVER 2005 database. The data in the database of system A is not encrypted, and the data in the database of system B is encrypted. Due to the commercial contract relationship, database B cannot be directly operated on. System B provides a corresponding webservice that can be used to synchronize basic data.

In order to solve this problem, the initial idea is to automatically synchronize the data to the database, modify data in small batches, add and Use triggers, and modify and add Intermediate tables and Job Scheduling in large quantities.

However, ifCallWebservice. I browsed some information on the Internet, basically SQLSERVERCallThe idea of the class library is similar to a data encryption project I previously created. The only difference is that the previous class library does not contain webservice.

Now that the idea is correct, start with it.

1. Use VS2005 to create a class library Solution

2,ReferenceWebservice to be used

3. Create the UserSynchronization and DepSynchronization classes in the class file to synchronize users and departments.

To facilitate the databaseCallThe methods of both classes are static, and each class provides only one masterCallMethod. Take the DepSynchronization class as an example for databaseCallThe method is as follows:

4. Compile the class library. Under release, four files are generated, two of which are DLL files.

5. register classes in the database and mapCallFunction.

There was a problem with the ing function. At first I set the parameter type of the database function to varchar, causing SQL-CLR Type mismatch, the original string type ing in C # Should Be nvarchar. In addition, the bool ing to SQLSERVER2005 should be bit.

6. test:

Select dbo. SeeyonOperateDepart ('creater', 'service-admin', '1984020.suzhou ', 'test2014', 'test departments ');

System Error:

After searching relevant information, we found that ***. XmlSerializers. DLL, another dll file generated during compilation, is used to serialize and deserialize webservice.ReferenceMust be registered to SQLSERVER. Right-click the programmable-program set-create assembly and register this class.

7. Test OK again

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.