Thanks Jon you really been a big help,
Don't I need a .dll for the Mono.Data.Sqlite or does that come automatically
when you create a project?
Because I just imported an sqlite from other project, worked fine.
Though, I still have a few questions..
if I use the GetConnection() method then he doesn't find my file because it
searches in this path: C:/Users/Myuser/Documents/items3.db
Now when I add the items3.db in that folder (now he should find it) he still
executes the if(!exist) statements, so he creates the database and fills it
with 1 record.
How am I able to fix that? should I put it in the resources folder or
something? Like I stated, I'm very new with this :p
Another question, I try to make a little login method which should return
the amount of rows.. I made this method out of your examples, but when I use
the method on the emulator the app just simply goes to the home screen and
crashes.
public static int GetLogin(string username)
{
int count = 0;
WithCommand(c =>
{
c.CommandText = "SELECT * FROM Items WHERE Key = 'sample'
LIMIT 1'";
var r = c.ExecuteReader();
while (r.Read())
{
count = (int)(long)r[0];
}
});
return count;
}
2011/9/15 Jonathan Pryor <[email protected]>
> On Sep 15, 2011, at 3:08 AM, Mittchel Van Vliet wrote:
> > I really appreciate your help since I'm really new to this stuff.. but
> the methods like WithCommand are just regually in there?
>
> No, WithCommand() is a helper method within the same source file:
>
>
> https://github.com/xamarin/monotouch-samples/blob/master/MonoCatalog-MonoDevelop/MonoDataSqlite.xib.cs#L262
>
> As for adding the Mono.Data.Sqlite assembly, look for System.Data.SQLite
> within the assembly browser. (Yes, I know, that's very confusing, but if you
> read the .csproj afterward it lists Mono.Data.Sqlite. I need to investigate
> why this happens.)
>
> - Jon
>
> _______________________________________________
> Monodroid mailing list
> [email protected]
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid