Beispiel #1
0
        public void verimagen() // Reconvertimos la imagen
        {
            Conexion       con = new Conexion();
            SqlDataAdapter da  = new SqlDataAdapter();
            SqlCommand     cmd = new SqlCommand();

            cmd.Connection = con.estableserconexion();
            con.Abrirconexion();
            string sql = "select Imagen from Arbitros where IDarbitro ='" + datos.IDarbitros1 + "'";

            cmd.CommandText  = sql;
            da.SelectCommand = cmd;

            DataSet ds = new DataSet("Imagen");

            da.Fill(ds, "Imagen");

            //crear un arreglo baits
            byte[]  dato = new byte[0];
            DataRow dr   = ds.Tables["Imagen"].Rows[0];

            dato = (byte[])dr["Imagen"];
            System.IO.MemoryStream ms = new System.IO.MemoryStream(dato);
            pictureBox1.Image = System.Drawing.Bitmap.FromStream(ms);
        }
Beispiel #2
0
        public void verimagen()
        {
            try
            {
                Conexion       con = new Conexion();
                SqlDataAdapter da  = new SqlDataAdapter();
                SqlCommand     cmd = new SqlCommand();
                cmd.Connection = con.estableserconexion();
                con.Abrirconexion();
                string sql = "select Foto from Noticias where Clave ='" + datos.Id + "'";
                cmd.CommandText  = sql;
                da.SelectCommand = cmd;

                DataSet ds = new DataSet("Foto");
                da.Fill(ds, "Foto");

                //crear un arreglo baits
                byte[]  dato = new byte[0];
                DataRow dr   = ds.Tables["Foto"].Rows[0];
                dato = (byte[])dr["Foto"];
                System.IO.MemoryStream ms = new System.IO.MemoryStream(dato);
                ptbImageN.Image = System.Drawing.Bitmap.FromStream(ms);
            }
            catch
            {
                MessageBox.Show("Imagén no Encontrada", "Error");
            }
        }
Beispiel #3
0
        public DataTable busquedaEquiposCrede(object obj) //cargar combo de jugadores
        {
            Conexion   con   = new Conexion();
            LigasBO    datos = (LigasBO)obj;
            SqlCommand cmd   = new SqlCommand();

            cmd.Connection = con.estableserconexion();
            con.Abrirconexion();
            string         sql        = "Select IDequipo, Nombre from Equipo Ligas where IDliga ='" + datos.Id_Liga + "'";
            SqlDataAdapter usuario    = new SqlDataAdapter(sql, con.estableserconexion());
            DataTable      tablaacate = new DataTable();

            usuario.Fill(tablaacate);
            con.Cerrarconexion();
            return(tablaacate);
        }