我有包含 clob 列的表。我想将 HTML 数据保存到那个(c#)中。当我保存时,我收到一个错误:字符串文字太长。我存储的字符串长度是 8048 个字符
谁能帮我?在此先感谢表是: CREATE TABLE tblhelp ( GRID LONG )
private string getHTML(GridView gv)
{
StringBuilder sb = new StringBuilder();
StringWriter textwriter = new StringWriter(sb);
HtmlTextWriter htmlwriter = new HtmlTextWriter(textwriter);
gv.RenderControl(htmlwriter);
htmlwriter.Flush();
textwriter.Flush();
htmlwriter.Dispose();
textwriter.Dispose();
return sb.ToString();
}
public override void VerifyRenderingInServerForm(Control control)
{
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET
server control at run time. */
return;
}
protected void btnTest_Click(object sender, EventArgs e)
{
// string grid = getHTML(GridView1);
TextBox7.Text = getHTML(GridView1);
OdbcConnection DbConnection1 = new OdbcConnection(con1);
try
{
DbConnection1.Open();
OdbcCommand DbCommand1 = DbConnection1.CreateCommand();
//DbCommand1.CommandText = "UPDATE TBL_ITHELPDESK SET STATUS='"+ chkClosed.Text +"',CLOSED_BY='"+drpClosedBy.Text+"',CLOSED_ON=TO_DATE('"+txtClosedOn.Text.ToString().Trim()+"','MM-DD-YYYY')WHERE CALL_NO='" + txtCallNo.Text + "'";
DbCommand1.CommandText = "insert into tblhelp(grid) values('" + TextBox7.Text.Replace("'", "''").Trim() + "')";
TextBox7.Text=DbCommand1.CommandText.ToString();
int t1 = DbCommand1.ExecuteNonQuery();
if (t1 == 1)
{
DbConnection1.Close();
}
else
{
}
}
catch (Exception ex)
{
}
}