Hi,

Jb has a valid point about different underlying types, so I modified
the patch a bit.

Mart Roosmaa
Index: SqliteDataReader.cs
===================================================================
--- SqliteDataReader.cs	(revision 65274)
+++ SqliteDataReader.cs	(working copy)
@@ -323,7 +323,10 @@
 		
 		public long GetBytes (int i, long fieldOffset, byte[] buffer, int bufferOffset, int length)
 		{
-			throw new NotImplementedException ();
+			byte[] data = (byte[])(((object[]) rows[current_row])[i]);
+			if (buffer != null)
+				Array.Copy (data, fieldOffset, buffer, bufferOffset, length);
+			return data.LongLength - fieldOffset;
 		}
 		
 		public char GetChar (int i)
Index: SqliteCommand.cs
===================================================================
--- SqliteCommand.cs	(revision 65274)
+++ SqliteCommand.cs	(working copy)
@@ -192,8 +192,10 @@
 					Sqlite.sqlite3_bind_null (pStmt, i);
 					continue;
 				}
-					
+				
 				Type ptype = param.Value.GetType ();
+				if (ptype.IsEnum)
+					ptype = Enum.GetUnderlyingType (ptype);
 				
 				SqliteError err;
 				
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 65274)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2006-09-14  Mart Roosmaa <[EMAIL PROTECTED]> 
+
+	* SqliteDataReader.cs: Implemented GetBytes ().
+	* SqliteCommand.cs: Handle enums by their underliying type.
+
 2006-08-20  Joshua Tauberer  <[EMAIL PROTECTED]>
 
 	* SqliteConnection.cs: Changed Version property (which is
_______________________________________________
Mono-devel-list mailing list
Mono-devel-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-devel-list

Reply via email to