Hi all,

Im new to desktop development in .net, Ive been tring to insert data
into an sql server ce database and it does not seem to be updating
properly. Ive tried using both the tableadapter.insert() method and
also using sql strings and both didnt work correctly.

In the code below I have checked to see if the rows were inserted
using cmmd.ExcuteCommandNonQuery() and it confirms on row was updated
but when opening the server explorer the data was not inserted.

Any help would be appreciated
John


            SqlCeConnection conn = null;

            try
            {
                conn = new SqlCeConnection("Data Source = |
DataDirectory|\\Database1.sdf;");
                conn.Open();

                SqlCeCommand cmd = conn.CreateCommand();
                cmd.CommandText = "INSERT INTO Record ([ABV],
[measure], [AlcoholName]) Values(55 ,789 ,'test')";

                int connam = cmd.ExecuteNonQuery();

            }
            finally
            {
                conn.Close();

            }

        }

Reply via email to