On Wed, Jul 13, 2011 at 7:07 AM, Tino <[email protected]> wrote:
> Here is code:
>
> conn.Open();
> SqlCeCommand cmd = new SqlCeCommand("INSERT INTO tbl (no, col1, col2,
> col3) VALUES ('10', 'something', '12/27/2012 04:21', 'someth')",
> conn);
> cmd.ExecuteNonQuery();
> conn.Close();
>
> problem is that this just doesn't work. It does't show any error
> message but no data is inserted.
>
> When I use some SELECT statement instead of INSERT it works fine (so I
> guess db connection is good).  When I take this command text into SQL
> query editor it inserts data fine
>  ( so I guess command syntax is fine).
>
> Does anybody has any idea what may be the problem???

Does the user in your conn have rights to read and write or just read only?

consider Int32 retVal = cmd.ExecuteNonQuery();

and see what value you are getting back.
-- 
Stephen Russell

Unified Health Services
60 Germantown Court
Suite 220
Cordova, TN 38018

Telephone: 888.510.2667

901.246-0159 cell

-- 
You received this message because you are subscribed to the Google
Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML
Web Services,.NET Remoting" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
or visit the group website at http://megasolutions.net

Reply via email to