Fatal Error 682 on SqlCacheDependency
- From: JoshG <jsgough@xxxxxxxxx>
- Date: Fri, 12 Oct 2007 15:30:56 -0000
Hello,
I have tried two ways for executing a query and creating a dependency
on it, one using plain Sql commands, the other using Enterprise
Library wrapped commands.
I keep getting:
Warning: Fatal error 682 occurred at Oct 12 2007 11:01AM. Note the
error and time, and contact your system administrator.
string xml = cmd.ExecuteScalar() as string;
When I execute it. Does anyone know what could cause this.
I have read both of these posts and have not yet been able to
investigate the SQL machine's event viewer though:
http://forums.asp.net/p/959871/1188606.aspx#1188606
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1203630&SiteID=1
The "value" column is an XML datatype field.
Thanks,
Josh
public static ContentXmlUtilResult GetContentXml(
string key,
bool createDependency)
{
ContentXmlUtilResult result = new ContentXmlUtilResult();
string connString = Global.Current.ConnectionString;
using (SqlConnection conn =
new SqlConnection(connString))
{
SqlCommand cmd =
new SqlCommand(
"SELECT Value FROM dbo.ContentXml WHERE [Key]
= '" + key + "'",
conn);
if (createDependency)
{
System.Web.Caching.SqlCacheDependency dependency =
new SqlCacheDependency(cmd);
result.Dependency = dependency;
}
conn.Open();
string xml = cmd.ExecuteScalar() as string;
conn.Close();
result.Content = xml;
}
return result;
//SqlCommand cmd = (SqlCommand)
// Global.Current.Database.GetSqlStringCommand(
// //@"SELECT Value FROM dbo.ContentXml WHERE [Key] =
@Key");
// @"SELECT Value FROM dbo.ContentXml WHERE [Key] = '"
+ key + "'");
////cmd.Parameters.Add("@Key", SqlDbType.VarChar).Value =
key;
//if (createDependency)
//{
// System.Web.Caching.SqlCacheDependency dependency =
// new System.Web.Caching.SqlCacheDependency(cmd);
// result.Dependency = dependency;
//}
//string xml = Global.Current.Database.ExecuteScalar(cmd)
as string;
//result.Content = xml;
//return result;
}
.
- Prev by Date: Sporadic "Cannot find Table 0" Error
- Next by Date: DbProviderFactories and multiple versions of connector FAILS
- Previous by thread: Sporadic "Cannot find Table 0" Error
- Next by thread: DbProviderFactories and multiple versions of connector FAILS
- Index(es):
Relevant Pages
|