System.Data.SqlClient.SqlException: '.' 附近有语法错误。怎么解决啊?
usingSystem;usingSystem.Collections;usingSystem.Configuration;usingSystem.Data;usingS...
using System;
using System.Collections;
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.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.IO;
public partial class bbs_viewArticle : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string id = Request.Params["id"];
if (id == null || id.Length <= 0)
Response.Redirect("Default.aspx");
else
{
string sql = "updata articles set clockCount=clockCount+1 where id=" + id;
using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string sql = "insert into review(aid,remen,retitle,recontent,reip) values(" + Request.Params["id"] + ",'" + txtReMen.Text + "','" + txtReTitle.Text + "','" + txtRecontent.Text + ",'" + Request.UserHostAddress + "')";
using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStrings"].ConnectionString))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
DataList2.DataBind();
txtRecontent.Text = "";
txtReMen.Text = "";
txtReTitle.Text = "";
}
}
就是改不出来哪里有错!求指点!
我现在一共只有10分!
谢谢了!
改了,可还是那样。我做的是一个博客,下面那个是提交评论,上面那个是统计文章点击次数 展开
using System.Collections;
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.Data.Sql;
using System.Data.SqlClient;
using System.Data.SqlTypes;
using System.IO;
public partial class bbs_viewArticle : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string id = Request.Params["id"];
if (id == null || id.Length <= 0)
Response.Redirect("Default.aspx");
else
{
string sql = "updata articles set clockCount=clockCount+1 where id=" + id;
using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
}
}
protected void Button1_Click(object sender, EventArgs e)
{
string sql = "insert into review(aid,remen,retitle,recontent,reip) values(" + Request.Params["id"] + ",'" + txtReMen.Text + "','" + txtReTitle.Text + "','" + txtRecontent.Text + ",'" + Request.UserHostAddress + "')";
using (SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStrings"].ConnectionString))
{
conn.Open();
SqlCommand cmd = new SqlCommand(sql, conn);
cmd.ExecuteNonQuery();
conn.Close();
}
DataList2.DataBind();
txtRecontent.Text = "";
txtReMen.Text = "";
txtReTitle.Text = "";
}
}
就是改不出来哪里有错!求指点!
我现在一共只有10分!
谢谢了!
改了,可还是那样。我做的是一个博客,下面那个是提交评论,上面那个是统计文章点击次数 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询