Store the text entered by the user as it is in the database C#
<p>How to store the text entered by the user as it is in the database. Suppose if the user entered the text in proper case then the data should be stored in proper case in the database. If the user entered the text in upper case then the data should be stored in upper case and likewise. I am changing the textbox style property according to the user setting in the database. If the user setting is in proper case then using style i am setting the textbox property to title case and proper case likewise. But when storing the data the text is entered in lower case irrespective of the case in which the user entered.</p>

<pre><code>CompanyMasterClass cm = new CompanyMasterClass();
    cm.strcompany_code = Request.Cookies["userinfo"]["companycode"];
    ResultClass objress = cm.fn_GetNameNumberStyle();
    if (objress.bStatus)
    {
        eslist&lt;CompanyMasterClass&gt; OBJLISTS = objress.objData as eslist&lt;CompanyMasterClass&gt;;
        if (OBJLISTS.Count &gt; 0)
        {
            ViewState["namestyle"] = OBJLISTS[0].strname_style.ToString();
            if (OBJLISTS[0].strname_style.ToString() == "PC")
            {
                //txtGroupName.Text = "";
                //txtGroupSname.Text = "";
            }
            if (OBJLISTS[0].strname_style.ToString() == "UC")
            {
                txtGroupName.Style.Add("text-transform", "uppercase");
                txtGroupSname.Style.Add("text-transform", "uppercase");
                lblGroupName.Style.Add("text-transform", "uppercase");
            }
            if (OBJLISTS[0].strname_style.ToString() == "UG")
            {
                // txtGroupName.Text = "";
                //txtGroupName.Text = "";
            }
        }
    }
</code></pre>

<p>Here I am setting the textbox style according to the property set in the database by the user. </p>

<p>How to store the text entered by the user with the case in the database?</p>

<p>Thanks,</p>
