URL: http://atnd.org/events/34622
自称Booistaのshinriyoです。
一昨日しっぱいで、さらに昨日のアドベントカレンダー(http://d.hatena.ne.jp/shinriyo/20121210)では失敗したので、再再トライ。
一応SqliteTest.db の確認しました。
> sqlite3 SqliteTest.db SQLite version 3.7.7 2011-06-25 16:35:41 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> select * from MONO_TEST; 5|Mono
MONO_TESTテーブルもあり、中身もあるようです。
ここの行で行なっている。5と'Mono'のINSERTもうまく行ってますね。
dbcmd.CommandText = 'INSERT INTO MONO_TEST ' + '(NID, NDESC )' + 'VALUES(5,\'Mono\')'
多分、ExecuteReader()の返り値のジェネリックスの方が悪いと思って、色々試したがわからない・・・。
# reader = dbcmd.ExecuteReader() # reader = dbcmd.ExecuteQuery[of IDataReader]() # reader = dbcmd.ExecuteQuery[of (object)]() # reader = dbcmd.ExecuteQuery[of (string)]()
dbcmd.ExecuteQuery[of (string)]()で行った時のエラー。
MissingMethodException: Method not found: 'Default constructor not found...ctor() of System.String[]'. System.Activator.CreateInstance (System.Type type, Boolean nonPublic) System.Activator.CreateInstance (System.Type type) SQLite.SQLiteCommand+<ExecuteDeferredQuery>c__Iterator0`1[System.String[]].MoveNext () (at Assets/Plugins/SQLite.cs:1756) System.Collections.Generic.List`1[System.String[]].AddEnumerable (IEnumerable`1 enumerable) System.Collections.Generic.List`1[System.String[]]..ctor (IEnumerable`1 collection) System.Linq.Enumerable.ToList[String[]] (IEnumerable`1 source) SQLite.SQLiteCommand.ExecuteQuery[String[]] () (at Assets/Plugins/SQLite.cs:1714) SqliteTest.Awake () (at Assets/SqliteTest.boo:42)
SQlite.csの
while (SQLite3.Step (stmt) == SQLite3.Result.Row) { var obj = Activator.CreateInstance(map.MappedType); for (int i = 0; i < cols.Length; i++) {
の部分で怒られるようだ。
MissingMethodException: Method not found: 'Default constructor not found...ctor()
ってなんだろう?デフォルトコンストラクタが「...ctor()」を見つけられない?「...ctor()」ってなんだ!
constructor()の略?
→ ちなみにこの部分で怒られてる
「Activator.CreateInstance メソッド」・・・指定したパラメータに最も一致するコンストラクタを使用して、指定した型のインスタンスを作成します。
文字列で指定したクラスのインスタンスを作成するものっぽい?
しかしわからないので諦めて次回は別のことします・・・。
そもそもBooが対応してないわけ無いと思うけど。
NHibernateかな?