User1152736709 posted
Try adjusting your code as such:
protected void Page_Load( EventArgs e)
{
string connectionString = "your connection string";
OleDbConnection conn = new OleDbConnection(connectionString);
conn.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.Connection = conn;
cmd.CommandText = "SELECT COUNT(*) AS TOTAL FROM VIDEO_MOJI WHERE (UserId = @UserId)";
cmd.Parameters.Add("@UserId", OleDbType.Integer).Value = 239;
int counter = (int)cmd.ExecuteScalar();
lblTotalCount.Text = "Result:" + counter.ToString();
conn.Close();
}
Use a parameter (@UserId) to supply a user id (which I assume is an integer) to the query. Ofcourse you need to replace 239 with a value of your own.