Re: ExecuteNonQuery -> Unexpected error message

From: Val Mazur (group51a_at_hotmail.com)
Date: 08/31/04


Date: Mon, 30 Aug 2004 20:50:39 -0400

Hi,

Like for me error is definitely related to the COM-based ADO, not to the
.NET Managed Provider for SQL Server. Are you sure that you get an error
from the posted code? are you using any additional DLL file, which were
created as a COM?

-- 
Val Mazur
Microsoft MVP
"James Dixon" <jamessdixon@yahoo.com> wrote in message 
news:u%23y1YspjEHA.3664@TK2MSFTNGP11.phx.gbl...
>I have a 2 tier app with IIS6 hitting a 2K database via a code snippet in
> Session_Start (below)
>
> What's odd is that it is generating a ADODB.Field error '80020009' (Either
> BOF or EOF is true, or the current record has been deleted.  Requested
> operating requires a current record) on some machines.
>
> My questions:
> 1) I am not using a datatable, so how can I get a BOF/EOF?
> 2) Why isn't the catch, well, cathing this???
>
>
>   SqlConnection cn = new SqlConnection(strCN);
>   SqlCommand cmdLogVisit = new SqlCommand("usp_InsertVisitLog", cn);
>   cmdLogVisit.CommandType = CommandType.StoredProcedure;
>   SqlParameter prmIPAddress = new SqlParameter();
>   prmIPAddress.ParameterName = "@IPAddress";
>   prmIPAddress.SqlDbType = SqlDbType.VarChar;
>   prmIPAddress.Size = 15;
>   prmIPAddress.Direction = ParameterDirection.Input;
>   cmdLogVisit.Parameters.Add(prmIPAddress);
>
>   try
>   {
>
>    prmIPAddress.Value = Request.UserHostAddress;
>    cn.Open();
>    cmdLogVisit.ExecuteNonQuery();
>   }
>   catch(Exception e)
>   {
>
>   }
>   finally
>   {
>    cn.Close();
>   }
>
>