Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btn_Procurar_Click(object sender, EventArgs e)
- {
- Informacao = tbx_Informacao.Text;
- //Segunda parte
- string connStr = "Driver={MySQL ODBC 5.2 ANSI Driver}; Server=localhost; Database=db_fingercontrol; User=root; Password=;Option=3";
- OdbcConnection conn = new OdbcConnection(connStr);
- OdbcCommand stringSQL_Login = conn.CreateCommand();
- stringSQL_Login.CommandText = "SELECT Nome, RG, CPF, FROM Cliente WHERE " + TipoInfo + " = " + Informacao;
- try
- {
- conn.Open();
- OdbcDataReader reader = stringSQL_Login.ExecuteReader();
- while (reader.Read())
- {
- tbx_Nome.Text = reader["Nome"].ToString();
- tbx_RG.Text = reader["RG"].ToString();
- tbx_CPF.Text = reader["CPF"].ToString();
- tbx_Telefone.Text = reader[""].ToString();'
- }
- }
- catch
- {
- MessageBox.Show("Ocorreu um erro na execução do SQL");
- conn.Close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment