日期:2014-05-20 浏览次数:20764 次
private void draw01()//houdu1
{
string connStr = ConfigurationManager.ConnectionStrings["connStr"].ToString();
using (OleDbConnection conn = new OleDbConnection(connStr))
{
conn.Open();
DataSet ds = new DataSet();
OleDbDataAdapter da = new OleDbDataAdapter();
string com = "select top 8 [ID],[DateAndTime],[HouDu1] from [No1Gear] order by [ID] desc ";
TextBox4.Attributes.Add("onkeypress", "this.value = this.value.replace(/[^0-9]/g,'')");
string com2 = "select top " + TextBox4.Text.ToString() + " [ID],[DateAndTime],[HouDu1] from [No1Gear] order by [ID] desc";
int num;
if (TextBox4.Text.ToString() == ""
------解决方案--------------------
TextBox4.Text.ToString() == "0")
{
da.SelectCommand = new OleDbCommand(com, conn);
num = 0;
}
else
{
da.SelectCommand = new OleDbCommand(com2, conn);