I have my db set to content
I access it like this
var db = new SqliteConnection("Data Source=db.sqlite");
using (var cmd = db.CreateCommand())
{
db.Open();
cmd.CommandText = "select * from table";
using (var reader = cmd.ExecuteReader())
{
while (reader.Read())
{
// do something with results here - cast column values appropriately
string value = (string)reader["columnname"];
}
}
}
On Thu, Apr 26, 2012 at 9:38 AM, Chris_M <[email protected]> wrote:
>
> I've been able to use variations of the tutorial code and gallery sample
> code to use sqlite-net to create a database in code, create tables,
> populate
> them, etc. However, for the project I'm working on now, I have an sqlite
> database pre-built in the Firebox sqlite tool, with one table already
> populated with data, and I have not been able to get this to work.
>
> When I add the database file to my project, should the Build Action be set
> to Content (as I thought), or Compile, or EmbeddedResource?
>
> Also, can some kind soul provide sample code of how to use sqlite-net to
> open an existing database and read all the records from a specific table
> into a List collection of objects?
>
> As always, any help is *greatly* appreciated!
>
>
> --Chris M.
>
>
> --
> View this message in context:
> http://monotouch.2284126.n4.nabble.com/Need-help-working-with-existing-database-using-sqlite-net-tp4590024p4590024.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> [email protected]
> http://lists.ximian.com/mailman/listinfo/monotouch
>
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch