DATABASE - Validando dados
string sql04 = "select LOGIN_EMAIL from TABLE_USUARIO where LOGIN_EMAIL='" + TxtEmail.Text+"'";
SqlConnection connection = new SqlConnection("Data Source=localhost;Initial Catalog=DB;Integrated Security=True");
SqlCommand execc = new SqlCommand(sql04, connection);
connection.Open();
object result = execc.ExecuteScalar();
if (result != null)
{
MsgEmail.Text ="Email já cadastrado!";}
if (result == null) { //ação a ser realizada}
Att,
Leonardo Rocha.
Nenhum comentário:
Postar um comentário
Informações de contato
Nome:
E-mail:
Telefone: