asp.net Access Database Overflow errors _ practical tips

Source: Internet
Author: User
The following method is written to return the number of rows affected by the data operation:
Copy Code code as follows:

private int Getreturnvalue (string sStr, String conn) {
OleDbConnection odbconn = ACCESSHELP (conn);
OleDbCommand odbcmd = new OleDbCommand (SSTR, odbconn);
Return Odbcmd. ExecuteNonQuery ();
}

Use one of the following methods to invoke this class:
Copy Code code as follows:

public int WSBM (string[] str) {
StringBuilder sb=new StringBuilder ();
Sb. Append ("INSERT into"). Append ("WSBM (Zy, Studentname, ParentName)");
Sb. Append ("VALUES (");
Sb. Append ("' + str[0] +" ', ' "+ str[1] +" ', ' "+ str[2] +" ");
Sb. Append (")");
Return Getreturnvalue (sb.) ToString (), "Odbconn");
}

To send data in this event:
Copy Code code as follows:

protected void Bttj_click (object sender, EventArgs e) {
string[] sStr = new string[] {
This.ddlzy.SelectedItem.Text,
This.tbName.Text,
This.tbbb.Text,
};
if (AD.WSBM (SSTR) > 0) {
Response.Write (' <script>alert (' Insert success! ') </script> ");
}
}

After the implementation of the results of the following figure, what is the reason???

How to solve such a benefit error?????

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.