Try to connect to domino using. net

Source: Internet
Author: User

Import the dll that contains the Domino namespace: Interop. Domino. dll.
 

Install the notes client.
 

 

Accessing domino starts with creating a NotesSession object. So the first problem is the initialization of the NotesSession object. The Initialize (string password) method of the NotesSession object is intuitive but confusing, because even people who have never been in touch with domino know how to create a session. The user name and password are required, the method here has only one password parameter. The reason here does not need to be further investigated, because the notes client will find the user name information based on the user. id file in the system, and the password part is the thing to verify. If you have worked in domino development, you should have a deeper understanding of this part.

 

Obtain the data list from the domino data file and sort it into the able.
 

1 NotesSession ns = new NotesSession ();
2 ns. Initialize ("password ");
3 if (ns! = Null)
4 {
5 db = ns. GetDatabase ("DOMINO server address", "data file address", false );
6 view = db. GetView ("view name ");
7 NotesDocument doc = view. GetFirstDocument ();
8 DataTable dt = new DataTable ();
9 DataColumn dc = new DataColumn ("column name 1 ");
10 dt. Columns. Add (dc );
11 dc = new DataColumn ("column name 2 ");
12 dt. Columns. Add (dc );
13 while (doc! = Null)
14 {
15 DataRow dr = dt. NewRow ();
16 Object [] oba = (Object []) doc. ColumnValues;
17 string colm1, colm2;
18 colm1 = oba [0]. ToString ();
19 colm2 = oba [1]. ToString ();
20 dr. BeginEdit ();
21 dr ["column name 1"] = colm1;
22 dr ["column name 2"] = colm2;
23 & nbs

Related Article

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.