I'm trying to migrate my program from mdb to SQLite. In general, it is not so difficult job. I simply changed all appearances of "OleDb" to "SQLite" (search and replace option works fine).
The only errors are related with SQL parameters.
For example, If we consider thic piece of code:
and after changing of 'OleDb' to 'SQLite' we get this message:
'System.Data.SQLite.SQLiteType' is not accessible in this context because it is 'Friend'.
it wasn't so difficult to correct this into:
well... things were much more complicated with this code:
it looks like that SQLite namespace doesn't contain property with name "SQLiteType" oposed to "OleDb.OleDbType". How I can correct this?
Also, there's a similar problem with this command:
While you can change Add to AddWithWalue and remove 'OleDb.OleDbType.VarChar', how we can do the same with: 'SQLite.SQLiteType.Binary'? The 2nd parameter of 'AddWithValue' must be some numeric value but how to know which one if you're working with BLOB objects?
The only errors are related with SQL parameters.
For example, If we consider thic piece of code:
vb Code:
cmd.Parameters.Add(New OleDb.OleDbParameter("@ID", OleDb.OleDbType.VarChar, 20)) cmd.Parameters.Add(New OleDb.OleDbParameter("@Name", OleDb.OleDbType.VarChar, 20))
and after changing of 'OleDb' to 'SQLite' we get this message:
Quote:
'System.Data.SQLite.SQLiteType' is not accessible in this context because it is 'Friend'.
Code:
cmd.Parameters.AddWithValue("@ID", 20)
cmd.Parameters.Add("@Name", 20)
vb Code:
cmd.Parameters.AddWithValue("@fid", SQLite.SQLiteType.Char).Value = txtID.Text
it looks like that SQLite namespace doesn't contain property with name "SQLiteType" oposed to "OleDb.OleDbType". How I can correct this?
Also, there's a similar problem with this command:
vb Code:
cmd.Parameters.AddWithValue("@ID", 20) cmd.Parameters.AddWithValue("@pic", SQLite.SQLiteType.Binary)
While you can change Add to AddWithWalue and remove 'OleDb.OleDbType.VarChar', how we can do the same with: 'SQLite.SQLiteType.Binary'? The 2nd parameter of 'AddWithValue' must be some numeric value but how to know which one if you're working with BLOB objects?