异常详细信息: System.Data.SqlClient.SqlException: 必须声明标量变量 "@sxh".
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSys...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data;
using System.Data.SqlClient;
public partial class insert : System.Web.UI.Page
{
string sql = WebConfigurationManager.AppSettings ["myconn"];
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btntj_Click(object sender, EventArgs e)
{
string sxh = this.tbx_ID.Text;
string sxm = this.tbx_xm.Text;
string sxb = RadioButtonList1.SelectedItem.Text;
string szy = DropDownList1.SelectedItem.Text;
string scsrq = this.tbx_csrq.Text;
string sdk; if (CheckBox1.Checked)
{
sdk = "是";
}
else sdk = "否";
string ssfz = this.tbx_sfz.Text;
string sjg = this.tbx_jg.Text;
string sjtdz = this.tbx_jtdz.Text;
SqlConnection conn = new SqlConnection(sql);
string da = "insert into xsdate(ID,xm,xb,zy,csrq,dk,sfz,jg,jtdz) values(@sxh,@sxm,@sxb,@szy,@scsrq,@sdk,@ssfz,@sjg,@sjtdz)";
SqlCommand cmd = new SqlCommand (da ,conn );
conn.Open();
if (cmd.ExecuteNonQuery() > 0)
{
Response.Write("添加成功");
}
cmd.Prepare();
conn .Close (); 展开
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Configuration;
using System.Data;
using System.Data.SqlClient;
public partial class insert : System.Web.UI.Page
{
string sql = WebConfigurationManager.AppSettings ["myconn"];
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btntj_Click(object sender, EventArgs e)
{
string sxh = this.tbx_ID.Text;
string sxm = this.tbx_xm.Text;
string sxb = RadioButtonList1.SelectedItem.Text;
string szy = DropDownList1.SelectedItem.Text;
string scsrq = this.tbx_csrq.Text;
string sdk; if (CheckBox1.Checked)
{
sdk = "是";
}
else sdk = "否";
string ssfz = this.tbx_sfz.Text;
string sjg = this.tbx_jg.Text;
string sjtdz = this.tbx_jtdz.Text;
SqlConnection conn = new SqlConnection(sql);
string da = "insert into xsdate(ID,xm,xb,zy,csrq,dk,sfz,jg,jtdz) values(@sxh,@sxm,@sxb,@szy,@scsrq,@sdk,@ssfz,@sjg,@sjtdz)";
SqlCommand cmd = new SqlCommand (da ,conn );
conn.Open();
if (cmd.ExecuteNonQuery() > 0)
{
Response.Write("添加成功");
}
cmd.Prepare();
conn .Close (); 展开
1个回答
碧茂科技
2023-10-18 广告
2023-10-18 广告
作为上海碧茂信息科技有限公司的工作人员,对于Hadoop集群中小文件过多的问题,可以采取以下处理方法:1. 使用Hadoop Archive(HAR)文件技术。HAR是一种Hadoop文件系统中的归档格式,可将小文件组合成一个大文件,从而降...
点击进入详情页
本回答由碧茂科技提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |