QUOTE(Braindead @ 30 Jun, 2009 - 12:54 PM)

Because my little tool needs only to run on a desktop system.
So the user don't need to install a sql-server or similar.
It's just for the data connection to the database file.
Now this is my code, but the IDE shows another error
CommandText property has not been initiliazed
CODE
SqlCeConnection conn = null;
conn = new SqlCeConnection(ConnString);
SqlCeCommand cmd = conn.CreateCommand();
SqlCeDataAdapter da = new SqlCeDataAdapter(cmd);
SqlCeCommandBuilder CB = new SqlCeCommandBuilder(da);
da.Update(Dataset, "Test");
Sorry bud, but SQLCeConnection is for Windows CE OS and mobile. SQLConnetion is part of the framework so there will not be a needed install. So you are using this for a mobile device?
you need to set your DataAdapter's UpdateCommand to the your command builder.
For example (I am pulling this from the SQLDataAdpater example on MSDN)
CODE
// Create the UpdateCommand.
command = new SqlCommand(
"UPDATE Customers SET CustomerID = @CustomerID, CompanyName = @CompanyName " +
"WHERE CustomerID = @oldCustomerID", connection);
// Add the parameters for the UpdateCommand.
command.Parameters.Add("@CustomerID", SqlDbType.NChar, 5, "CustomerID");
command.Parameters.Add("@CompanyName", SqlDbType.NVarChar, 40, "CompanyName");
SqlParameter parameter = command.Parameters.Add(
"@oldCustomerID", SqlDbType.NChar, 5, "CustomerID");
parameter.SourceVersion = DataRowVersion.Original;
adapter.UpdateCommand = command;
You are missing the last line.
This post has been edited by modi123_1: 30 Jun, 2009 - 11:20 AM