Unspecified error | FrameWork 1.1 | ASP.net | SQL 2000

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I get this error once in a while and I normally could fix it by restarting IIS. However, I would like to find out what causes this. Can anyone help?

-----------------------------error screen-----------------------------------

System.Data.OleDb.OleDbException: Unspecified error

at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr)

at System.Data.OleDb.OleDbDataReader.GetRowHandles()

at System.Data.OleDb.OleDbDataReader.ReadRowset()

at System.Data.OleDb.OleDbDataReader.Read()

at System.Data.OleDb.OleDbDataReader.HasRowsRead()

at System.Data.OleDb.OleDbDataReader.NextResult()

at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)

at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable)

at DreamweaverCtrls.DataSet.DoInit()<hr>System.Data.OleDb.OleDbException: Unspecified error

at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr)

at System.Data.OleDb.OleDbDataReader.GetRowHandles()

at System.Data.OleDb.OleDbDataReader.ReadRowset()

at System.Data.OleDb.OleDbDataReader.Read()

at System.Data.OleDb.OleDbDataReader.HasRowsRead()

at System.Data.OleDb.OleDbDataReader.NextResult()

at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)

at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable)

at DreamweaverCtrls.DataSet.DoInit()<hr>System.Exception: The DefaultView was requested but no tables yet exist.

at DreamweaverCtrls.DataSet.get_DefaultView()<hr>System.Data.OleDb.OleDbException: Unspecified error

at System.Data.OleDb.OleDbDataReader.ProcessResults(Int32 hr)

at System.Data.OleDb.OleDbDataReader.GetRowHandles()

at System.Data.OleDb.OleDbDataReader.ReadRowset()

at System.Data.OleDb.OleDbDataReader.Read()

at System.Data.OleDb.OleDbDataReader.HasRowsRead()

at System.Data.OleDb.OleDbDataReader.NextResult()

at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method)

at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.OleDb.OleDbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)

at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable)

at DreamweaverCtrls.DataSet.DoInit()<hr>System.Exception: The DefaultView was requested but no tables yet exist.

at DreamweaverCtrls.DataSet.get_DefaultView()<hr>

----------------------- web.config -----------------------------------------------------
<configuration><appSettings><add key="CONNECTION_HANDLER_app_Conn" value="default_oledb.htm" /><add key="CONNECTION_STRING_app_Conn" value="Provider=SQLOLEDB.1;Password=password;User ID=username;Initial Catalog=dbname;Data Source=123.123.123.123" /><add key="CONNECTION_DATABASETYPE_app_Conn" value="OleDb" /><add key="CONNECTION_SCHEMA_app_Conn" value="" /><add key="CONNECTION_CATALOG_app_Conn" value="" /></appSettings></configuration>
 
GotdotNet said:
I get this error once in a while and I normally could fix it by restarting
IIS. However, I would like to find out what causes this. Can anyone help?
For whatever reason, you appear to be working with a DataView for a table
that is not being brought into existence in your code. Two bits of advice
for getting a more meaningful error message:

a) Use the native System.Data.SqlClient provider, instead of OleDb, i.e.
instead of the OleDbDataAdapter, use the SqlDataAdapter, etc.
b) Put the SQL execution inside a try/catch block, throw your own exception,
and then publish the info from the InnerException. Like this:

try
{
cmd.ExecuteNonQuery();
}
catch (SqlException E)
{
System.Text.StringBuilder MyErr = new System.Text.StringBuilder();
MyErr.Append("A Data exception occured\r\n");
MyErr.Append("Source: " + E.Source);
MyErr.Append("\r\nMessage:" + E.Message);
if (E.InnerException != null)
{
MyErr.Append("\r\nInner: " + E.InnerException.Message);
}
throw new SystemException(MyErr.ToString());
}
 
Rich - Thanks for your advice!

Here's the issue, where should I place the try/catch block in this page?

----------------------------------- sample.aspx -------------------------------------------------

<%@ Page Language="VB" ContentType="text/html" debug="false"%><%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" Assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %><MM:DataSet
runat="Server"
id="GETStuff"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("CONNECTION_STRING_app_Conn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("CONNECTION_DATABASETYPE_app_Conn") %>'
CommandText="dbo._RunSProc"
Debug="true"
<Parameters><Parameter Name="@id" Value='<%# IIf((Request.QueryString("id") <> Nothing), Request.QueryString("id"), "") %>' Type="Integer" Direction="Input" /><Parameter Name="@string" Value='<%# "Take this" %>' Type="VarChar" Direction="Input" /></Parameters></MM:DataSet><MM:PageBind runat="server" PostBackBind="true" /><html><head><title>Test</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><%
server.Execute(GETStuff.FieldValue("NavTopHTML", Container))
%><ASP:Repeater runat="server" DataSource='<%# GETStuff.DefaultView %>'><ItemTemplate><a href="goto.aspx?id=<%# GETStuff.FieldValue("id", Container) %>"><%# GETStuff.FieldValue("Item", Container) %></a><Br></ItemTemplate></ASP:Repeater></body></html>
 
Maybe I should format this for easier viewing:

<%@ Page Language="VB" ContentType="text/html" debug="false"%><%@ Register TagPrefix="MM" Namespace="DreamweaverCtrls" assembly="DreamweaverCtrls,version=1.0.0.0,publicKeyToken=836f606ede05d46a,culture=neutral" %><MM:DataSet
runat="Server"
id="GETStuff"
IsStoredProcedure="true"
CreateDataSet="true"
ConnectionString='<%# System.Configuration.ConfigurationSettings.AppSettings("CONNECTION_STRING_app_Conn") %>'
DatabaseType='<%# System.Configuration.ConfigurationSettings.AppSettings("CONNECTION_DATABASETYPE_app_Conn")
%>'
CommandText="dbo._RunSProc"
Debug="true"><Parameters><Parameter Name="@id" Value='<%# IIf((Request.QueryString("id") <> Nothing), Request.QueryString("id"), "") %>' Type="Integer" Direction="Input" /><Parameter Name="@string" Value='<%# "Take this" %>' Type="VarChar" Direction="Input" /></Parameters></MM:DataSet><MM:PageBind runat="server" PostBackBind="true" /><html><head><title>Test</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><% server.Execute(GETStuff.FieldValue("NavTopHTML", Container)) %><ASP:Repeater runat="server" DataSource='<%# GETStuff.DefaultView %>'><ItemTemplate><a href="goto.aspx?id=<%# GETStuff.FieldValue("id", Container) %>"><%# GETStuff.FieldValue("Item", Container) %></a><Br></ItemTemplate></ASP:Repeater></body></html>
 
Back
Top