如何将Textbox输入的字符串导入SQL数据库的表中 放到vs的IDE里,并去msdn上搜索类似sqlconnection或者sqlcommand之类的操作类。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 将asp:TextBox输入的字符串导入到sql数据库表中protected void btnAdd_Click(object sender, EventArgs e) { string ID; string sqlstr = "select * from tb_Blog where UserName='" + Session["UserName"] + "'"; DataSet mydataset = mydata.GetDataSet(sqlstr, "tb_Blog"); DataRowView rowview = mydataset.Tables["tb_Blog"].DefaultView[0]; ID = rowview["BlogID"].ToString(); //创建插入新文章信息的Sql语句 string com = "Insert into ST_news(ST_n_title,ST_n_author,ST_n_key,ST_n_content,ST_n_iscmd,ST_c_id,BlogID) values('" + this.txtSubject.Text + "','" + this.Session["UserName"].ToString() + "','" + this.TextBox1.Text + "','" + this.article_context.Text.ToString() + "','" + cbox + "','" + this.DropDownList1.SelectedValue + "','" + ID + "')"; //调用公共类中的ExceSQL方法,返回一个布尔值 bool add =mydata.ExceSQL(com); if (add)//codego.net/tags/11/1/ { Response.Write("<script language=javascript>alert('信息插入成功!');location='ArticleManage.aspx'</script>"); } else { Response.Write("<script language=javascript>alert('信息插入失败!');location='javascript:history.go(-1)'</script>"); } } 急求解决DES加密的问题。用的是ECB模式.在线等、 小弟初学者,有个疑问。。还望指点。。 怎么让自己的结构使用[]运算符 那位高手能提供PDF417生成&解码程序 求高手们回答!想在方法中定义另一个方法的问题! 极度郁闷,困扰我多年的问题!!!大家快来抢分啊 如何获取另一个应用程序的单击按钮事件 如何预读http头 我想取得CheckBoxList.datavaluefield的值,如何改下面的代码? 二维数组能作为DataGrid的数据源吗? 接口的变量为什么可以引用一个实现此接口的对象 前台代码中函数(yhw_list(); )在详细内容在什么地方,它后台文件删除了都可以用
protected void btnAdd_Click(object sender, EventArgs e)
{ string ID;
string sqlstr = "select * from tb_Blog where UserName='" + Session["UserName"] + "'";
DataSet mydataset = mydata.GetDataSet(sqlstr, "tb_Blog");
DataRowView rowview = mydataset.Tables["tb_Blog"].DefaultView[0];
ID = rowview["BlogID"].ToString();
//创建插入新文章信息的Sql语句
string com = "Insert into ST_news(ST_n_title,ST_n_author,ST_n_key,ST_n_content,ST_n_iscmd,ST_c_id,BlogID) values('" + this.txtSubject.Text + "','" + this.Session["UserName"].ToString() + "','" + this.TextBox1.Text + "','" + this.article_context.Text.ToString() + "','" + cbox + "','" + this.DropDownList1.SelectedValue + "','" + ID + "')";
//调用公共类中的ExceSQL方法,返回一个布尔值
bool add =mydata.ExceSQL(com);
if (add)//codego.net/tags/11/1/
{
Response.Write("<script language=javascript>alert('信息插入成功!');location='ArticleManage.aspx'</script>");
}
else
{
Response.Write("<script language=javascript>alert('信息插入失败!');location='javascript:history.go(-1)'</script>");
}
}