Anybody can help me to solved my problem ???
Here is the part of coding ....
SqlCeCommand sqlCmd1 = null;
using (sqlCmd1 = connSQLCE.CreateCommand())
{
sqlCmd1.CommandType = CommandType.Text;
sqlCmd1.CommandText = "DROP STATISTICS ON
tbEventLog";
sqlCmd1.ExecuteNonQuery();
sqlCmd1.CommandType = CommandType.Text;
sqlCmd1.CommandText = "CREATE STATISTICS ON
tbEventLog.PK_tbEventLog WITH FULLSCAN";
sqlCmd1.ExecuteNonQuery();
sqlCmd1.CommandType = CommandType.Text;
sqlCmd1.CommandText = "UPDATE STATISTICS ON
tbEventLog.PK_tbEventLog WITH FULLSCAN";
sqlCmd1.ExecuteNonQuery();
SqlCeCommand sqlCmd = null;
using (sqlCmd = new
SqlCeCommand("sp_show_statistics 'tbEventLog'", connSQLCE))
{
using (SqlCeDataReader tmpSQLDataReader =
sqlCmd.ExecuteReader())
{
if (tmpSQLDataReader.Read())
{
int ordTotalRecord =
tmpSQLDataReader.GetOrdinal("Rows");
if (!
tmpSQLDataReader.IsDBNull(ordTotalRecord))
{
nTotalRecord =
Convert.ToUInt32(tmpSQLDataReader.GetValue(ordTotalRecord));
}
}
tmpSQLDataReader.Close();
}
}
sqlCmd = null;
}
sqlCmd1 = null;
And the problem is, the 'ExecuteReader()' will trigger the error
'specific table does not exist'.
But, using SQLCE 3.1, above coding is working fine.
Thanking in advance for any suggestion.
Rgds,
Timotius Tingginehe