Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
2.33/5 (2 votes)
See more:
ob.fetch("select Email_id from Reciption_info where Email_Id='" + txtemail.Text + "'");
if (ob.ds.Tables[0].Rows.Count > 0)
{
lblmsg.Text = "already exits";
txtemail.Text.= "";
txtemail.Focus();

}
Posted

See that tiny little dot on line 5 of your code snippet?
C#
txtemail.Text. = "";

Should be this:
C#
txtemail.Text = "";


I'm assuming you're a beginner. Once you gain some experience you'll be able to spot these sort of syntax errors with your eyes shut. ;-)

BTW, Sergey mentioned in his answer that your script is open to SQL injection. You might want to take a good look at that...
 
Share this answer
 
Comments
sipun002 16-Mar-14 6:21am    
thank u sir for your guidance.yes sir i am a beginner.
Dot before '=' cannot be interpreted as anything allowed by the syntax. After this dot ('.'), some identifier is expected. Remove this dot, and you will see.

But even the first line is a big mistake. This is the invitation for a known exploit called SQL injection: http://xkcd.com/327[^].

For further detail, please see my past answers:
EROR IN UPATE in com.ExecuteNonQuery();[^],
hi name is not displaying in name?[^].

Correct approach is explained here:
http://msdn.microsoft.com/en-us/library/ff648339.aspx[^],
http://en.wikipedia.org/wiki/SQL_injection[^].

—SA
 
Share this answer
 
Comments
sipun002 16-Mar-14 6:20am    
thank u sir for your guidance.
Sergey Alexandrovich Kryukov 16-Mar-14 12:11pm    
You are very welcome.
Good luck, call again.
—SA

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