-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDefault.aspx.cs
27 lines (25 loc) · 889 Bytes
/
Default.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
using System;
using System.Data.SqlClient;
using System.Configuration;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnGetHtml_Click(object sender, EventArgs e)
{
string htmlCode = myHtml.Value;
string CS = ConfigurationManager.ConnectionStrings["SummernoteCS"].ConnectionString;
using (SqlConnection connect = new SqlConnection(CS))
{
using (SqlCommand cmd = new SqlCommand("insert into tblTypedText (Title, Text) values (@Title, @Text)"))
{
cmd.Connection = connect;
connect.Open();
cmd.Parameters.AddWithValue("@Title", tbxTitle.Text.Trim());
cmd.Parameters.AddWithValue("@Text", htmlCode);
cmd.ExecuteNonQuery();
}
}
}
}