Re: [sqlite] [sqlite-dev] Final preparations for the release of System.Data.SQLite v1.0.92.0 have begun...

2014-03-15 Thread Stefano Ravagni

I'm sorry, maybe i've not your knowledge 
...but could you tell me why in your mind database library for .net as 
MySql connector, ODBC for Postgres, all Access drivers, NPGSQL and many 
others permit read hasrows properties also after data association as i 
say and SQlite not ?

In addiction..what change in backward compatybilities ? I think nothing...
Who use datareader with "while .read do " continue to use in same 
waybut many others developer, who use HasRows for check if 
datareader has or had records will be gratified to this new 
capacity...don't think ??




Il 14/03/2014 2.01, Joe Mistachkin ha scritto:

Stefano Ravagni wrote:

Only SQL Server don't follow this line for what i know, and because of
that i abandon it in favor of SQlite (as file system database) and
PostgreSQL.


Well, the SQL Server provider is included with the .NET Framework itself
and I assume that they know how to properly implement their own database
access interfaces.


Tell me please because i'm not sure to had understand in next
version could i check dati.hasrows and have to return TRUE value also
after data association or have i to combine the use with StepCount
properties ?


No, for several reasons:

1. It would not be a backward compatible change.

2. It would not be compatible with several other ADO.NET providers
(e.g. SQL Server).

3. The IDataReader.Read() method return value can be used instead (see
example below) and has the additional benefit of being more widely
available since it is required on any class that implements the
IDataReader interface, not just those derived from the DbDataReader
abstract class.

bool hasRows = false;

do {
if (dataReader.Read()) {
hasRows = true;
// process this row...
} else {
// no more rows.
break;
}
} while (true);

if (hasRows) {
// more code here...
}

--
Joe Mistachkin

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users



___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Problem with sqlite3_exec

2014-03-15 Thread Kees Nuyt
On Fri, 14 Mar 2014 07:56:57 -0700 (PDT), khaloud1987
 wrote:

> the problem arises when I am trying to erase lines and I have a power failure
> so that it deletes rows but sometimes I have a line that is deleted from the
> first table and not from the second.
> (yes i have a table with this name table2 and i can't read the return value
> when it fails caused by the power failure)

So, after a power failure, you want both deletes to have succeeded, or
none at all. That behaviour is called atomicity (the A in ACID), and the
way to obtain that is to wrap the statements in a transaction.

BEGIN;
DELETE FROM table1 WHERE ...;
DELETE FROM table2 WHERE ...;
COMMIT;

-- 
Groet, Cordialement, Pozdrawiam, Regards,

Kees Nuyt

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users