RadioDld.SQLiteMonDataReader.GetOrdinal C# (CSharp) Method

GetOrdinal() public method

public GetOrdinal ( string name ) : int
name string
return int
        public int GetOrdinal(string name)
        {
            return this.wrappedReader.GetOrdinal(name);
        }

Usage Example

示例#1
0
        protected internal static Bitmap RetrieveImage(int imgid)
        {
            using (SQLiteCommand command = new SQLiteCommand("select image from images where imgid=@imgid", FetchDbConn()))
            {
                command.Parameters.Add(new SQLiteParameter("@imgid", imgid));

                using (SQLiteMonDataReader reader = new SQLiteMonDataReader(command.ExecuteReader()))
                {
                    if (!reader.Read())
                    {
                        return(null);
                    }

                    // Get the size of the image data by passing nothing to getbytes
                    int    dataLength = (int)reader.GetBytes(reader.GetOrdinal("image"), 0, null, 0, 0);
                    byte[] content    = new byte[dataLength];

                    reader.GetBytes(reader.GetOrdinal("image"), 0, content, 0, dataLength);

                    using (MemoryStream contentStream = new MemoryStream(content))
                    {
                        using (Bitmap streamBitmap = new Bitmap(contentStream))
                        {
                            return(new Bitmap(streamBitmap));
                        }
                    }
                }
            }
        }
All Usage Examples Of RadioDld.SQLiteMonDataReader::GetOrdinal