Data, post, write XML, new Big Data

Source: Internet
Author: User
Code
String [] S = new string [] {"1", "2 "}
VaR I = S. Select (STR => Int. prase (STR). toarray ();

Int [] lowerbounds = {1 };
Int [] lengths ={ 100 };
Int [] array = (INT []) array. createinstance (typeof (INT), lengths, lowerbounds );
An array with a length of 100 and a subscript starting from 1 is created!

Set the postbackurl attribute of botton, imagebotton, and linkbotton to B. aspx on page A. In this way, the information of page a can also be retrieved.
If (previouspage. iscrosspagepostback = true ){
String info = (textbox) This. previouspage. findcontrol ("Control ID, such as a textbox"). text;
}
Or it can be
String info = reques. Form ["textbox1"]. tostring ();

This write XML can reduce thread conflicts ..
String xmlfilepath = server. mappath ("~ /INFO/consultative. xml ");
Filestream FS = new filestream (xmlfilepath, filemode. Open, fileaccess. readwrite );
Xmldocument doc1 = new xmldocument ();
Doc1.load (FS );
FS. Close ();
Xmlnodelist nodelist = Doc. selectnodes ("consultative/INFO ");
Foreach (xmlnode node in nodelist)
{
Foreach (xmlnode nodechild in node. childnodes)
{
If (nodechild. Name = "UUID" & nodechild. innertext! = Viewstate ["UUID"]. tostring ())
Break;
If (nodechild. Name = "Answer ")
Nodechild. innertext = fckeditor1.value;
If (nodechild. Name = "Question ")
Nodechild. innertext = fckeditor2.value;
}
}
FS = new filestream (xmlfilepath, filemode. Open, fileaccess. readwrite );
Doc. Save (FS );
FS. Close ();

Void application_start (Object sender, eventargs E)
{
System. Threading. Thread fthread = new system. Threading. Thread (new system. Threading. threadstart (dosomething ));
Fthread. Start ();
}

Private void dosomething ()
{
While (true)
{
Try
{
// Code for processing the deadline
}
Catch
{
//
}

System. Threading. thread. Sleep (600000); // <-one hour
}
}

In the WAP project. If WAP2.0 is used for a page

<Configuration>

<Location Path = "person/newphoto. aspx">
<System. Web>
<Browsercaps>

<Result type = "system. Web. Mobile. mobilecapabilities, system. Web. Mobile, version = 1.0.5000.0, culture = neutral, publickeytoken = b03f5f7f11d50a3a"/>
<Use VaR = "http_user_agent"/>

Preferredrenderingtype = "XHTML-MP"

</Browsercaps>
</System. Web>
</Location>

</Configuration>

Here is the addition of big data
1 private sub button#click () sub button#click (byval sender as system. Object, byval e as system. eventargs) handles button1.click
2 dim t as new system. Data. datatable
3 dim C as system. Data. datacolumn
4 dim SW as new system. Diagnostics. Stopwatch
5 Sw. Start ()
6 dim conn as new system. Data. sqlclient. sqlconnection ("Data Source = JXBW-YESHUNQUAN \ sqlexpress; initial catalog = test; Integrated Security = true ")
7 conn. open ()
8 C = new system. Data. datacolumn ("ID ")
9 T. Columns. Add (c)
10 C = new system. Data. datacolumn ("name ")
11 T. Columns. Add (c)
12 C = new system. Data. datacolumn ("sex ")
13 T. Columns. Add (c)
14 C = new system. Data. datacolumn ("remark ")
15 t. Columns. Add (c)
16 dim BC as new system. Data. sqlclient. sqlbulkcopy (conn)
17 BC. destinationtablename = "tbl1"
18 dim I as long
19 for I = 1 to 100000
20 t. Rows. Add (I, "gsdgfsdfg" & I, "male", "adfasdfasdddsssssssssssssssss I love China ")
21 if I mod 100 = 0 then
22 BC. writetoserver (T, datarowstate. added)
23 T. Rows. Clear ()
24 end if
25 next I
26 conn. Close ()
27 Sw. Stop ()
28 Debug. Print (SW. elapsedmilliseconds/1000 & "seconds ")
29 end sub

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.