Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server CE / April 2008

Tip: Looking for answers? Try searching our database.

Alter Table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MDB - 04 Apr 2008 14:17 GMT
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

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.