Hi,
this is trivial task.
write code to handle button click event. on that code open connection to
DB and create SQL query to check if the E-mail value exist in DB :
private void Button1_Click(object sender, System.EventArgs e)
{
System.Data.SqlClient.SqlConnection oCon;
System.Data.SqlClient.SqlCommand oCmd;
try
{
oCon = new System.Data.SqlClient.SqlConnection("Your connection
string to DB");
oCon.Open();
oCmd = new System.Data.SqlClient.SqlCommand("select emailadress from
newsletter where emailadress = '" + email.Text + "'",oCon);
object strRetVal = oCmd.ExecuteScalar ();
if ( strRetVal == null)
{
//mail isnt exist in DB
}
}
catch
{
}
finally
{
if (oCmd != null)
oCmd.Dispose ();
if (oCon.State != System.Data.ConnectionState.Closed)
oCon.Close();
if (cCon != null)
oCon.Dispose ();
}
}
Natty Gur[MVP]
blog :
http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!