Posted on: 3/25/2011 2:07:13 AM | Views : 245

Hi
I would like to ask when im trying to store some data into sql using Server.HtmlEncode Could i use code behind for example like this ?
 
{
        string textbox1 = Server.HtmlEncode(TextBox1.Text.Trim());

     
        string connectionString = ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString;
        string insertSql = "INSERT INTO newpost(article) VALUES(@article)";

        using (SqlConnection myConnection = new SqlConnection(connectionString))
        {
            myConnection.Open();


            SqlCommand myCommand = new SqlCommand(insertSql, ...

Go to the complete details ...