Hi All,
how to save (") Double Quotes,,in Sql Server Database in asp.Net Database through asp.Net TextBox?
Thanx In Advance,
Regards,
Sathish Pababthi
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pankaj PandeyPosted May 31, 2013, 5:37 AM
you do not need to replace it again
see here
and result is
Rekha SinghPosted May 31, 2013, 4:57 AM
string str = "" + "" + "";
SqlConnection conn = new SqlConnection(str);
conn.Open();
string insertquery = "insert into table(dbfield1) values(@dbfield1)";
SqlCommand cmd = new SqlCommand(insertquery, conn);
string value = "";
if (db1 != null)
{
cmd.Parameters.AddWithValue("@dbfield1", db1);
}
else
{
cmd.Parameters.AddWithValue("@dbfield1", value);
}
cmd.ExecuteNonQuery();
Sathish PabbathiPosted May 31, 2013, 4:42 AM
Pankaj PandeyPosted May 31, 2013, 4:40 AM
try this
string str= TextBox1.Text.Replace('"', '\"');
and use str.
Sathish PabbathiPosted May 31, 2013, 4:40 AM