有无语法错误,帮我改改谢谢using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Sys

来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/07 21:45:52
有无语法错误,帮我改改谢谢usingSystem;usingSystem.Configuration;usingSystem.Data;usingSystem.Linq;usingSystem.Web

有无语法错误,帮我改改谢谢using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Sys
有无语法错误,帮我改改谢谢
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Globalization;
using System.Data.SqlClient;
public partial class fileSelect:System.Web.UI.Page
{
string connStr=ConfigurationManager.AppSettings["ConnectionString"].ToString();
SqlConnection sqlConn;
SqlCommand sqlComm;
protected void Page_Load(object sender,EventArgs e)
{
if(!IsPostBack)
bind() ;
}
public void bind()
{
sqlConn=new SqlConnection(connStr);
sqlConn.Open();
string sqlstr="selected * from table where 1=1";
if(CB_title.Selected)
{
TB_title.Enabled=true;
sqlstr+="and fileTitle='"%+TB_title.Text%"'";
TB_title.Enabled=false;
}
if(CB_office.Selected)
{
sqlstr+="and fileOffice='"+DDL_office.SelectedItem+"'";
}
if(CB_year.Selected)
{
sqlstr+="and fileYear='"+DDL_year.SelectedItem+"'";
}
if(CB_date.Selected)
{
DateTime startDate=(DateTime)"'"+TB_dateMin.Text+"'";
DateTime endDate=(DateTime)"'"+TB_dateMax.Text+"'";
startDate.ToString("yyyy-mm-dd",DateTimeFormatInfo.InvariantInfo);
starDate.ToString("yyyy-mm-dd",DateTimeFormatInfo.InvariantInfo);
sqlstr+="and reciveDate='"convert(varchar(10),reciveDate,120) between startDate and endDate"'";
}
if(CB_fileWord.Selected)
{
sqlstr+="and 文件字='"+DDL_fileWord.SelectedItem+"'";
}
if(CB_no.Selected)
{
TB_noMin.Enabled=true;
TB_noMax.Enabled=true;
sqlstr+="and receiveNo='"BETWEEN +TB_noMin.Text AND +TB_noMax.Text"'";
TB_noMin.Enabled=false;
TB_noMax.Enabled=false;
}
if(CB_secretLevel.Selected)
{
sqlstr+="and secretLevel='"+DDL_secretLevel.SelectedItem+"'";
}
if(CB_emergency.Selected)
{
sqlstr+="and emergency='"+DDL_emergency.SelectedItem+"'";
}
sqlComm=new sqlCommand(sqlStr,sqlConn);
sqlComm.ExecuteNonQuery();
sqlConn.Close();
bind();
}
}

有无语法错误,帮我改改谢谢using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Sys
1.所有的and前应该加个空格,否则会和上面的语句拼在一起
比如
sqlstr+="and fileTitle='"%+TB_title.Text%"'";
应该修改为
sqlstr+=" and fileTitle='"%+TB_title.Text%"'";
2.时间这里处理有问题,变量不能包括在双引号里面
if(CB_date.Selected)
{
DateTime startDate=(DateTime)"'"+TB_dateMin.Text+"'";
DateTime endDate=(DateTime)"'"+TB_dateMax.Text+"'";
startDate.ToString("yyyy-mm-dd",DateTimeFormatInfo.InvariantInfo);
starDate.ToString("yyyy-mm-dd",DateTimeFormatInfo.InvariantInfo);
sqlstr+="and reciveDate='"convert(varchar(10),reciveDate,120) between startDate and endDate"'";
}
可以修改为
if(CB_date.Selected)
{
sqlstr+= string.Format(" and reciveDate between '{0}' and '{1}'",TB_dateMin.Text,TB_dateMax.Text);
}

有无语法错误,帮我改改谢谢using System;using System.Configuration;using System.Data;using System.Linq;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.HtmlControls;using System.Web.UI.WebControls;using Sys 帮我看看有无语法错误吧!帮我改改Red Cross Society of China is a unitary Red Cross organization of the People's Republic of China , a social relief and aid society that engages in humanitarian work. It is the largest charity in modern Ch 帮我看一看这篇作文有无语法错误! 英语翻译帮我改改! 麻烦帮我改改! 对吗,不对帮我改改 帮我改改英语选择题 帮我注释一下每行代码,就是解释下每行的意思,谢谢了using System;using System.Globalization;using System.Text.RegularExpressions;using System.Windows.Forms; namespace Text{ public partial class Form1 : Form { private s 帮我改改托福作文吧····谢谢大家···· 帮我看看这个演讲搞.帮我演讲搞改改.语法错误.或者有什么不对的直接帮我改下谢谢!Knowing your audience is essentialMost of us are aware that communication is one of the important and basic ways.I think verbal communicat 你能帮我改改吗? 那你能帮我改改吗 帮我改改哪个选项哪儿错 at present most young people like pop music because the song sound melody words of song isapropos our life sometimes reaction our voice .能不能帮我改改语法错误~ 帮我改改语法错误!Use two pieces of about 1.0mm sheet steel and place them under gear,lightly harmmer the small shaft with diameter 帮忙改改托福作文~~~~谢谢啦!谢谢啦~~~~真心请你们帮我改改作文··7月份要考试了,作文还没什么头绪.呜呜···我全部的分就这点了,不好意思哇!Do you agree or disagree with the following statement? It’s 英语好的高手帮我改一下语法错误吧,如果句子不通可以适当的改改.是料理鼠王的.SETTING:First,Remy was rushed to a dining room inthe sewers.When he sewers came out,he finds it was Mr Gusteau’s restaurant.Then his luck fe The girl who so beautiful that is my lover It's Azi有语病 高手帮我改改了