我用一个freetextbox 写一文章 然后提交到数据库 用gridview控件显示出来
可是都是html格式
我参照csdn里面的帖子用了很多的方法搞了四五天还是没能搞定 请大侠给一个详细的处理方法 多谢!!!!
freetextbox中的内容:
string xx="2002-03-28";
DataTime dt=System.Convert.ToDateTime(xx);
gridview中显示内容:
string xx="2002-03-28"; <BR> DataTime dt=System.Convert.ToDateTime(xx); 代码:
dataconn.gerconnect();
//string mysql = "insert into t_forum (fchrForumID,fchrForumCaption,fchrFatherID,fchrForumDetail,fchrOperatorID,fbitNoUsed,fdtmDate) values (" + basicInformation.getReBackNum(int.Parse(DetailsView1.Rows[0].Cells[1].Text)).ToString() + ",'" + TextBox3.Text + "', '" + DetailsView1.Rows[0].Cells[1].Text + "','" + TextBox2.Text + "','" + Session["getInID"].ToString() + "',' ','2006-11-08')";
//string mysql = string.Format("insert into t_forum (fchrForumID,fchrForumCaption,fchrFatherID,fchrForumDetail,fchrOperatorID,fdtmDate,fbitNoUsed) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
// basicInformation.getReBackNum(DetailsView1.Rows[0].Cells[1].Text).ToString(), TextBox3.Text, DetailsView1.Rows[0].Cells[1].Text, TextBox2.Text, Session["getInID"].ToString(), DateTime.Now, ' ');
string mysql = string.Format("insert into t_forum (fchrForumID,fchrForumCaption,fchrFatherID,fchrForumDetail,fchrOperatorID,fdtmDate) values(@fchrForumID,@fchrForumCaption,@fchrFatherID,@fchrForumDetail,@fchrOperatorID,@fdtmDate)");
SqlCommand cm = new SqlCommand(mysql, dataconn.connectionsql);
cm.Parameters.Add("@fchrForumID", SqlDbType.VarChar,50);
cm.Parameters.Add("@fchrForumCaption", SqlDbType.VarChar, 100);
cm.Parameters.Add("@fchrFatherID", SqlDbType.VarChar, 50);
cm.Parameters.Add("@fchrForumDetail", SqlDbType.VarChar, 5000);
cm.Parameters.Add("@fchrOperatorID", SqlDbType.VarChar, 50);
cm.Parameters.Add("@fdtmDate", SqlDbType.VarChar,50);
//cm.Parameters.Add("@fbitNoUsed", SqlDbType.Bit); cm.Parameters[0].Value=basicInformation.getReBackNum(DetailsView1.Rows[0].Cells[1].Text).ToString();
cm.Parameters[1].Value = TextBox3.Text;
cm.Parameters[2].Value = DetailsView1.Rows[0].Cells[1].Text;
cm.Parameters[3].Value = TextBox2.Text;
cm.Parameters[4].Value = Session["getInID"].ToString();
cm.Parameters[5].Value = basicInformation.getTime();
//cm.Parameters[6].Value = " ";
//SqlCommand mycmd = new SqlCommand(mysql, dataconn.connectionsql);
cm.ExecuteNonQuery();
basicInformation.getUserPark(Session["getInID"].ToString(),4);
dataconn.disconnect();请大家多多帮忙,不胜感激!!!1
可是都是html格式
我参照csdn里面的帖子用了很多的方法搞了四五天还是没能搞定 请大侠给一个详细的处理方法 多谢!!!!
freetextbox中的内容:
string xx="2002-03-28";
DataTime dt=System.Convert.ToDateTime(xx);
gridview中显示内容:
string xx="2002-03-28"; <BR> DataTime dt=System.Convert.ToDateTime(xx); 代码:
dataconn.gerconnect();
//string mysql = "insert into t_forum (fchrForumID,fchrForumCaption,fchrFatherID,fchrForumDetail,fchrOperatorID,fbitNoUsed,fdtmDate) values (" + basicInformation.getReBackNum(int.Parse(DetailsView1.Rows[0].Cells[1].Text)).ToString() + ",'" + TextBox3.Text + "', '" + DetailsView1.Rows[0].Cells[1].Text + "','" + TextBox2.Text + "','" + Session["getInID"].ToString() + "',' ','2006-11-08')";
//string mysql = string.Format("insert into t_forum (fchrForumID,fchrForumCaption,fchrFatherID,fchrForumDetail,fchrOperatorID,fdtmDate,fbitNoUsed) values('{0}','{1}','{2}','{3}','{4}','{5}','{6}')",
// basicInformation.getReBackNum(DetailsView1.Rows[0].Cells[1].Text).ToString(), TextBox3.Text, DetailsView1.Rows[0].Cells[1].Text, TextBox2.Text, Session["getInID"].ToString(), DateTime.Now, ' ');
string mysql = string.Format("insert into t_forum (fchrForumID,fchrForumCaption,fchrFatherID,fchrForumDetail,fchrOperatorID,fdtmDate) values(@fchrForumID,@fchrForumCaption,@fchrFatherID,@fchrForumDetail,@fchrOperatorID,@fdtmDate)");
SqlCommand cm = new SqlCommand(mysql, dataconn.connectionsql);
cm.Parameters.Add("@fchrForumID", SqlDbType.VarChar,50);
cm.Parameters.Add("@fchrForumCaption", SqlDbType.VarChar, 100);
cm.Parameters.Add("@fchrFatherID", SqlDbType.VarChar, 50);
cm.Parameters.Add("@fchrForumDetail", SqlDbType.VarChar, 5000);
cm.Parameters.Add("@fchrOperatorID", SqlDbType.VarChar, 50);
cm.Parameters.Add("@fdtmDate", SqlDbType.VarChar,50);
//cm.Parameters.Add("@fbitNoUsed", SqlDbType.Bit); cm.Parameters[0].Value=basicInformation.getReBackNum(DetailsView1.Rows[0].Cells[1].Text).ToString();
cm.Parameters[1].Value = TextBox3.Text;
cm.Parameters[2].Value = DetailsView1.Rows[0].Cells[1].Text;
cm.Parameters[3].Value = TextBox2.Text;
cm.Parameters[4].Value = Session["getInID"].ToString();
cm.Parameters[5].Value = basicInformation.getTime();
//cm.Parameters[6].Value = " ";
//SqlCommand mycmd = new SqlCommand(mysql, dataconn.connectionsql);
cm.ExecuteNonQuery();
basicInformation.getUserPark(Session["getInID"].ToString(),4);
dataconn.disconnect();请大家多多帮忙,不胜感激!!!1
解决方案 »
- 讨论:一种更好的登录验证和密码保存算法
- asp.net全站生成静态怎么搞··非伪静态
- div+css如何架论坛.调CSS
- 如何获得页面上<form id="form1" runat="server">这个的类型对象?我想在CS里处理
- 验证模块的问题(IHttpModule)?
- 我是新手,请高手帮忙,急啊
- asp.net 如何做通行证
- 一个奇怪的配置问题,在server2003下安装了vs2003后,不能创建asp应用程序,出现以下错误
- 为什么我利用WebBrowser实现Web打印会出现问题
- CKEditor如何像数据库提交值.
- 如何提取 SQL 数据库中行中最大值的几列和最小值的几列?
- 关于角色访问验证的问题
大家多帮帮忙
多谢