MySQL large text parameters for serial write queue

Source: Internet
Author: User

 Public voidasyncwritedatabase () {varSpname ="";  while(true)            {                Try                {                varJsontext = Redishelper.blockingpopitemfromlist ("async_write_list"); varo =(Jobject) jsonconvert.deserializeobject (Jsontext); if(o["Need_newcache"]. ToString ()! ="0")Continue; Spname=o["Action"].                ToString (); varJobject = o["Paras"]; varparas =NewMysqlparameter[jobject.children ().                Count ()]; varCount =0; foreach(Jproperty IteminchJobject.children ()) {                    if(item. Value.tostring (). Length >=1024x768) {Paras[count]=NewMysqlparameter (item.                        Name, Mysqldbtype.mediumtext); //var bytes = System.Text.Encoding.UTF8.GetBytes (item.                         Value.tostring ()); //Paras[count].                        Value = bytes; //If the following code does not work, try the commented out code aboveParas[count]. Value =item.                    Value.tostring (); }                    Else{Paras[count]=NewMysqlparameter (item. Name, Mysqldbtype.varchar,1024x768); Paras[count]. Value=item.                        Value; } Count++;                  } sqlhelper.executenonquery (Sqlhelper.connectionstring, CommandType.StoredProcedure, SpName, paras); Program.myFrm.SetTextMessage ("the stored procedure that was successfully written to the asynchronous database record, called:"+ Spname,3); }                Catch(Exception err) {Program.myFrm.SetTextMessage ("failed to write to asynchronous database record, called stored procedure:"+ spname+", the cause of the error:"+err,3); }            }        }

MySQL large text parameters for serial write queue

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.