Fórum Porquê não seta o valor? #474463
29/03/2014
0
public static String add(Cliente cli, string result)
{
int i;
using (MySqlConnection conexaoMySQL = clsBanco.getInstancia().getConexao())
{
try
{
string mSQL = "SELECT count(*) FROM pessoa";
MySqlCommand cmd = new MySqlCommand(mSQL, conexaoMySQL);
conexaoMySQL.Open();
i = Convert.ToInt16(cmd.ExecuteScalar());
}
catch (MySqlException ex)
{
throw ex;
}
finally
{
conexaoMySQL.Close();
}
return result = i.ToString();
}
Raniel Gomes
Curtir tópico
+ 0Posts
29/03/2014
Raniel Gomes
Gostei + 0
29/03/2014
Raniel Gomes
public static void add(ComponentFactory.Krypton.Toolkit.KryptonTextBox texto)
{
int i;
string result;
using (MySqlConnection conexaoMySQL = clsBanco.getInstancia().getConexao())
{
try
{
string mSQL = "SELECT count(*) FROM pessoa";
MySqlCommand cmd = new MySqlCommand(mSQL, conexaoMySQL);
conexaoMySQL.Open();
cmd.ExecuteNonQuery();
i = Convert.ToInt16(cmd.ExecuteScalar())+1;
result = Convert.ToString(i);
texto.Text = result;
}
catch (MySqlException ex)
{
throw ex;
}
finally
{
conexaoMySQL.Close();
}
}
}
Gostei + 0
30/03/2014
Raniel Gomes
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)