Click here to Skip to main content
15,891,372 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am succeed in writing this value into the database
C#
cmd.Parameters.AddWithValue("@Email", txt_username.text);

but i need to add @gmail.com to it suffix, the below which i am trying fail to insert anything.
C#
cmd.Parameters.AddWithValue("@Email", txt_username.text + "@gmail.com");

Thanks,
Posted
Updated 3-Sep-13 22:56pm
v3
Comments
OriginalGriff 4-Sep-13 4:55am    
When you say "fail to insert anything" do you get an error?
You also mention an SP - what does that look like?
OPees 4-Sep-13 4:58am    
can check @Email Data-Type in SP as well as in c# too.
what is error?
sathish kumar 4-Sep-13 5:09am    
no error, it's not writing any value..

not only in SP. it's not writing the value even in normal sql command
OPees 4-Sep-13 5:21am    
can you put your code here?

Hi,
not clearly understand what you wnat try like this
but iam assuming you need something like this.

C#
String Emails=txt_username.Text.Trim() + "@gmail.com";
cmd.Parameters.AddWithValue("@Email",Emails);
 
Share this answer
 
Why not this way?
C#
string email_add=txt_username.text+ "gmail.com";
.....................
cmd.Parameters.AddWithValue("@Email",email_add);

Regards..:)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900