I just upgraded my mobile DBs to 3.0 and CF 2.0 and am now having problems
altering tables. If I run the sql form Query Analyzer 3.0 or from Microsoft
SQL Server Management Studio the sqls run fine however, if I run it from
within my application it never alters the table and always returns -1 with
no error. Below is how I am running it in my code, anyone have any ideas
why it isn't working?
SqlCeCommand dc = new SqlCeCommand(sql, conn, trans);
intResult = dc.ExecuteNonQuery();
dc.Dispose();
sql = ALTER TABLE company ADD COLUMN base_latitude nvarchar(20);
TIA
MDB - 07 Apr 2008 17:13 GMT
Figured it out:
The results didn't use to return -1 on a alter table , since it is now
returning -1 even though it was successful, I was rolling back the
transaction which is way it was appearing not to run. I just changed my
function to return 1 if it is an alter or create. Thanks
>I just upgraded my mobile DBs to 3.0 and CF 2.0 and am now having problems
>altering tables. If I run the sql form Query Analyzer 3.0 or from
[quoted text clipped - 10 lines]
>
> TIA
Ginny Caughey MVP - 07 Apr 2008 19:56 GMT
The return value of -1 is different from what I'd expect from the docs,
although it is in line with what you'd get with SqlClient. I've reported it
as a possible documentation error.
Ginny
> Figured it out:
>
[quoted text clipped - 17 lines]
>>
>> TIA

Signature
Ginny Caughey
Device Application Development MVP
www.wasteworks.com
Software for Waste Management