Reading,Writing, Editing BLOBS through DataTables and DataRows

Posted by Soham on Stack Overflow See other posts from Stack Overflow or by Soham
Published on 2010-04-06T03:06:53Z Indexed on 2010/04/06 3:13 UTC
Read the original article Hit count: 444

Filed under:
|

Consider this piece of code:

DataSet ds = new DataSet();
        SQLiteDataAdapter Da = new SQLiteDataAdapter(Command);
        Da.Fill(ds);

        DataTable dt = ds.Tables[0];
        bool PositionExists;
        if (dt.Rows.Count > 0) { PositionExists = true; }
        else { PositionExists = false; }
        if (PositionExists)
        {
            //dt.Rows[0].Field<>("Date")
        }

Here the "Date" field is a BLOB. My question is, a. Will reading through the DataAdapter create any problems later on, when I am working with BLOBS? More, specifically, will it read the BLOB properly?

b. This was the read part.Now when I am writing the BLOB to the DB,its a queue actually. I.e I am trying to store a queue in MySQLite using a BLOB. Will Conn.ExecuteNonQuery() serve my purpose?

c. When I am reading the BLOB back from the DB, can I edit it as the original datatype, it used to be in C# environment i.e

{ Queue -> BLOB -> ? }

{C# ->MySQL -> C# }

So in this context, Date field was a queue, I wrote it back as a BLOB, when reading it back, can I access it(and edit) as a queue?

Thank You.

Soham

© Stack Overflow or respective owner

Related posts about c#

Related posts about mysql