// INCLUIR NO BANCO public void incluir(ModeloCategoria mCategoria) { SqlCommand cmd = new SqlCommand(); cmd.Connection = daoConexao.Conexao; cmd.CommandText = "insert into categoria(cat_nome) values(@nome); select @@IDENTITY;"; cmd.Parameters.AddWithValue("@nome", mCategoria.CatNome); daoConexao.conectar(); mCategoria.CatCod = Convert.ToInt32(cmd.ExecuteScalar()); daoConexao.desconectar(); }