Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Specific table does not exist on SQLCE 3.5

18 views
Skip to first unread message

Timo

unread,
Jun 23, 2010, 5:01:33 AM6/23/10
to
Hi All,

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

0 new messages