在2005中将xml文件insert到数据库字段,字段为xml类型。 补充一下,xml文件内容insert到数据库字段,字段为xml类型。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 //price TextReader tr = new StringReader(hidxml.Value); DataSet ds = new DataSet(); ds.ReadXml(tr,XmlReadMode.Auto); for (int i=0;i<hidxml.Value.Split(',').Length;i++) { price = Convert.ToDouble(hidxml.Value.Split(',')[i].ToString()); totalPrice = Convert.ToDouble(hidxml.Value.Split(',')[i].ToString()); sql = "update Goods set unit_price =" + price + ",total_price = "+ totalPrice +" where id='"+ hidxml.Value.Split(',')[i].ToString() +"'"; Conn_Purchase.SqlHelper.ExecuteNonQuery(CommandType.Text,sql,null); }做个参考。hidxml.Value 为protected System.Web.UI.HtmlControls.HtmlInputHidden hidxml; 求SQL语句 更新表时``要读取另一表的COUNT(*)怎么写 问个最简单的问题 从SQL2000上查询密码 sql server安装出现挂起 SQL语句问题 急,想把本地数据库一个表中的N条记录导入到远程服务器的表中,如何实现? 用VFP做查询遇到的问题。急!急!急! 请问,为什么我的数据库不能进行事务日志备份???? 如何在插入记录以前锁住表,不允许别的插入动作? 请求SQL语句 如何找出每一组数据的前n条数据?
TextReader tr = new StringReader(hidxml.Value);
DataSet ds = new DataSet();
ds.ReadXml(tr,XmlReadMode.Auto);
for (int i=0;i<hidxml.Value.Split(',').Length;i++)
{
price = Convert.ToDouble(hidxml.Value.Split(',')[i].ToString());
totalPrice = Convert.ToDouble(hidxml.Value.Split(',')[i].ToString());
sql = "update Goods set unit_price =" + price + ",total_price = "+ totalPrice +" where id='"+ hidxml.Value.Split(',')[i].ToString() +"'";
Conn_Purchase.SqlHelper.ExecuteNonQuery(CommandType.Text,sql,null); }
做个参考。
hidxml.Value 为protected System.Web.UI.HtmlControls.HtmlInputHidden hidxml;