1
Answer

C sharp Deployement project reinstallation problem

shivesh  Jha

shivesh Jha

12y
1.1k
1
Hi,

I have Created  a windows application and a set up for that application.

when ever i try to re install that set up it will ask me to remove it from control panel 
and than install the set up.

So please suggest me how i can enable overright or repair option to this.

Thanks and Regards
Shivesh Kumar Jha.
Answers (1)
3
Nainil
NA 660 0 15y

.NET:   
   string
userString = textBox1.Text;
   string replacedString = userString.Replace("'", "''");
 
SQL:
   replacedString = Replace(userString,"'","''")
 
Hope this helps.
Accepted
1
Nainil
NA 660 0 15y

Hi Giorgio,
    Whenever you have single quotes, replace them with 2 single quotes. That should work.
0
Gustavo
NA 1.8k 386.6k 15y

Nainil:
 
Yes, thank you.
0
Gustavo
NA 1.8k 386.6k 15y

Nainil:
 
Can you give me a sample code of the 2 types?
 
0
Nainil
NA 660 0 15y

Giorgio,
   You can either use .NET string.Replace() method to replace any single quotes with 2 single qoutes or you can use T-SQL's Replace function. Since the value being inserted is passed in as a SqlParameter.Value property, you can run the Replace function through it and ensure that any string being passed to the stored procedure is clean. Hope this helps.
0
Gustavo
NA 1.8k 386.6k 15y

Nainil:
 
Yes, if it was a string. But it will be some text that the user entered. Is there a way to do it automatically when I put it into the sql command to save it?