Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Bases de datos > Firebird e Interbase
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

 
 
Herramientas Buscar en Tema Desplegado
  #2  
Antiguo 30-05-2011
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
No tengo tiempo, para mirarlo, pero echalo un ojo por si te puede servir de base.
Código SQL [-]
               BLOB Reading Example (C#)             

                                                TEST.SQL Script (Testing Database)

 Run the following script to create the testing database. It creates a simple table called MYTABLE with a single row. (How to create a database from an SQL script):
CREATE TABLE MYTABLE (     ID   INTEGER,     VAL  BLOB SUB_TYPE 0 SEGMENT SIZE 80 ); Reading values

 Because it is not possible to insert binary BLOB value in the SQL script we need to insert it in the code before reading.
 The following sample prints the values from the column "VAL" to console:
string database = "test.fdb";  CreateEmbeddedDb(database, "test.sql");  FbConnectionStringBuilder csb = new FbConnectionStringBuilder(); csb.ServerType = 1; csb.Database = database;  using (FbConnection c = new FbConnection(csb.ToString())) {   c.Open();          FbCommand cmdInsert = new FbCommand("INSERT INTO mytable(id, val) VALUES(@id, @val)", c);   cmdInsert.Parameters.Add("@id", 1);   cmdInsert.Parameters.Add("@val", new byte[] {1, 2, 3});   cmdInsert.ExecuteNonQuery();    FbCommand cmd = new FbCommand("SELECT val FROM mytable", c);            using (FbDataReader r = cmd.ExecuteReader())   {     while (r.Read())     {       int size = 20;       byte[] bytes = new byte[size];       long count = r.GetBytes(0, 0, bytes, 0, size);       for(int i = 0; i < count; i++)         Console.WriteLine("Value: " + bytes[i]);     }   } } 


             
                            
             Copyright © 2005 - 2007 DotNetFirebird
Un Saludo.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
error insert con campo incremental arefolio SQL 5 06-08-2008 12:46:02
Formatear BLOB en Insert jlcasih Firebird e Interbase 1 10-05-2006 20:20:17
Problema con insert y campo float Ivanzinho SQL 4 22-06-2005 10:07:22
campo blob acertij022 Conexión con bases de datos 1 19-08-2004 00:10:32


La franja horaria es GMT +2. Ahora son las 01:05:33.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi