[Mono-list] System.Data.SqlClient.SqlException: 'int' isnot a recognized CURSOR option
Ing. Michal Skala
michal@orix.sk
Fri, 15 Oct 2004 14:44:57 +0200
This is a multi-part message in MIME format.
--=====003_Dragon555784873818_=====
Content-Type: text/plain;
charset="windows-1250"
Content-Transfer-Encoding: 7bit
Hello,
stored procedure is OK. When I manualy create the SqlCommand code, everything is OK. But when I uses SqlCommandGenerator, that is in CommandGenerator.cs file, the code is bad. I use this code already one+ year and on .NET Framework works. But in Mono fails.
It seems that the System.Reflection used in CommandGenerator.cs works not good. I don't know, what's wrong. I don't care paste here the full source, the source is in attached file.
In _classes/DataAccess directory is full generator source. This can not be shorter, I think.
Next, the test_db.cs contains only one method, that is used to get data from db, and uses the SqlCommandGenerator method.
And next, the default.aspx page only calls the method, that is in test_db.cs.
The example cannot be shorter.
And here is the source of stored procedure:
CREATE PROCEDURE dbo.course_show
AS
Select
course_id, [name], open_date, close_date, url
From
course
GO
I don't know, what is wrong. When I manualy call this stored procedure, without the SqlCommandGenerator, everything is OK.
Example of my manual call:
public void UpdateView () {
SqlConnection connection=new SqlConnection(ConfigurationSettings.AppSettings["ConnStr"]);
SqlCommand command= new SqlCommand ("course_show", connection);
command.CommandType=CommandType.StoredProcedure;
DataSet ds=new DataSet();
adapter.Fill(ds);
ShowCourses.DataSource = ds; // datagrid fill
ShowCourses.DataBind();
}
This is only one example of many, that I have tested. Nothing works.
Thanks for help.
Michal
======== At 2004-10-15, 06:09:40 you wrote: ========
Hello
Looks like there is a problem with the System.Data.SqlClient code.
Can you please send the stored procedure that is getting executed from
the code?
Also if you can isolate and send only the sqlclient access portion of
the code as a unit testcase it would faster to debug and fix the
problem.
Regards
uma
> > > "Ing. Michal Skala" < michal@orix.sk> 10/14/04 5:50 PM > > >
Hello,
I have attached the full source.
And here is the full error output:
Server error in '/poll' application
Description: Error processing request.
Error Message: HTTP 500.
Stack Trace: System.Data.SqlClient.SqlException: 'int' is not a
recognized CURSOR option.
in < 0x0011b> System.Data.SqlClient.SqlConnection:ErrorHandler
(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
in < 0x00069> (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArgs
(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
in < 0x00031> Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage
(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
in < 0x00056> (wrapper remoting-invoke-with-check)
Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage
(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)
in < 0x00276> Mono.Data.Tds.Protocol.Tds:ProcessMessage
(Mono.Data.Tds.Protocol.TdsPacketSubType)
in < 0x00052> (wrapper remoting-invoke-with-check)
Mono.Data.Tds.Protocol.Tds:ProcessMessage
(Mono.Data.Tds.Protocol.TdsPacketSubType)
in < 0x0015f> Mono.Data.Tds.Protocol.Tds:ProcessSubPacket ()
in < 0x00050> Mono.Data.Tds.Protocol.Tds:NextResult ()
in < 0x00089> System.Data.SqlClient.SqlDataReader:NextResult ()
in < 0x0005d> (wrapper remoting-invoke-with-check)
System.Data.SqlClient.SqlDataReader:NextResult ()
in < 0x00122> System.Data.SqlClient.SqlDataReader:.ctor
(System.Data.SqlClient.SqlCommand)
in < 0x00056> (wrapper remoting-invoke-with-check)
System.Data.SqlClient.SqlDataReader:.ctor
(System.Data.SqlClient.SqlCommand)
in < 0x000a2> System.Data.SqlClient.SqlCommand:ExecuteReader
(System.Data.CommandBehavior)
in < 0x00054> (wrapper remoting-invoke-with-check)
System.Data.SqlClient.SqlCommand:ExecuteReader
(System.Data.CommandBehavior)
in < 0x00012>
System.Data.SqlClient.SqlCommand:System.Data.IDbCommand.ExecuteReader
(System.Data.CommandBehavior)
in < 0x000be> System.Data.Common.DbDataAdapter:Fill
(System.Data.DataSet,int,int,string,System.Data.IDbCommand,System.Data.CommandBehavior)
in < 0x00045> System.Data.Common.DbDataAdapter:Fill
(System.Data.DataSet)
in < 0x000f6> Test.App.Auth:Course_Show ()
in < 0x00016> ASP.login_aspx:UpdateView ()
in < 0x0000e> ASP.login_aspx:Page_Load (object,System.EventArgs)
in < 0x00069> (wrapper delegate-invoke)
System.MulticastDelegate:invoke_void_object_EventArgs
(object,System.EventArgs)
in < 0x00086> System.Web.UI.Control:OnLoad (System.EventArgs)
in < 0x00024> System.Web.UI.Control:LoadRecursive ()
in < 0x00198> System.Web.UI.Page:InternalProcessRequest ()
in < 0x000c2> System.Web.UI.Page:ProcessRequest
(System.Web.HttpContext)
in < 0x002eb> ExecuteHandlerState:Execute ()
in < 0x00084> StateMachine:ExecuteState
(System.Web.HttpApplication/IStateHandler,bool&)
Hello,
I have problem with running asp.net page in mono, that connect to
MS-SQL db on windows computer. Mono is installed on linux. This is an
error, that is throwed:
System.Data.SqlClient.SqlException: 'int' is not a recognized CURSOR
option
I have created a small application (one file, only login). This
application is on linux server with mono. This small application uses a
small library, that generated SqlCommand a than runs a stored procedure
on MS-SQL server. The library uses System.Reflection namespace (in
attachment).
When this small application run very well on .NET Framework and IIS on
Windows. But, I don't know, who is the problem in Mono.
Thank's for help me.
Michal
__________ Informacia od NOD32 1.893 (20041013) __________
Tato sprava bola preverena antivirusovym systemom NOD32.
http://www.eset.sk
Thanks for help me.
Michal
__________ Informacia od NOD32 1.895 (20041014) __________
Tato sprava bola preverena antivirusovym systemom NOD32.
http://www.eset.sk
= = = = = = = = = = = = = = = = = = = = = =
--=====003_Dragon555784873818_=====
Content-Type: text/html;
charset="windows-1250"
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1250">
<META content="MSHTML 6.00.2900.2523" name=GENERATOR></HEAD>
<BODY bgColor=#ffffff><FONT face=Tahoma size=2></FONT>
<DIV>
<DIV>
<DIV>
<DIV><FONT face=Tahoma size=2>Hello,</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>stored procedure is OK. When I manualy create the
SqlCommand code, everything is OK. But when I uses SqlCommandGenerator, that is
in CommandGenerator.cs file, the code is bad. I use this code already one+ year
and on .NET Framework works. But in Mono fails.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>It seems that the System.Reflection used in
CommandGenerator.cs works not good. I don't know, what's wrong. I don't care
paste here the full source, the source is in attached file.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>In _classes/DataAccess directory is full generator
source. This can not be shorter, I think.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>Next, the test_db.cs contains only one method,
that is used to get data from db, and uses the SqlCommandGenerator
method.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>And next, the default.aspx page only calls the
method, that is in test_db.cs.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>The example cannot be shorter. </FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>And here is the source of stored
procedure:</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><STRONG>CREATE PROCEDURE dbo.course_show</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG>AS</STRONG></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><STRONG>Select <BR> course_id, [name], open_date, close_date,
url<BR>From<BR> course<BR>GO</STRONG><BR></DIV>
<DIV><FONT face=Tahoma size=2>I don't know, what is wrong. When I manualy call
this stored procedure, without the SqlCommandGenerator, everything is
OK.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>Example of my manual call:</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2><STRONG>public void UpdateView ()
{</STRONG></FONT></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><FONT face=Tahoma size=2><STRONG> SqlConnection connection=new
SqlConnection(ConfigurationSettings.AppSettings["ConnStr"]);<BR> SqlCommand
command= new SqlCommand ("course_show",
connection);<BR> command.CommandType=CommandType.StoredProcedure;
</STRONG></FONT></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><FONT face=Tahoma size=2><STRONG> DataSet ds=new
DataSet();<BR> adapter.Fill(ds);</STRONG></FONT></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><FONT face=Tahoma size=2><STRONG> ShowCourses.DataSource = ds;
// datagrid fill<BR> ShowCourses.DataBind();</STRONG></FONT></DIV>
<DIV><STRONG></STRONG> </DIV>
<DIV><FONT face=Tahoma size=2><STRONG> } </STRONG></FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>This is only one example of many, that I have
tested. Nothing works.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>Thanks for help.</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>Michal</FONT></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV></DIV></DIV></DIV>
<DIV><FONT face=Tahoma size=2></FONT> </DIV>
<DIV><FONT face=Tahoma size=2>========
At 2004-10-15, 06:09:40 you wrote: ========</FONT></DIV>
<DIV><BR><FONT face=Tahoma size=2>
<TABLE width="100%">
<TBODY>
<TR>
<TD width="100%">
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>Hello</DIV>
<DIV> Looks like there is a problem with the System.Data.SqlClient code.</DIV>
<DIV>Can you please send the stored procedure that is getting executed from</DIV>
<DIV>the code?</DIV>
<DIV>Also if you can isolate and send only the sqlclient access portion of</DIV>
<DIV>the code as a unit testcase it would faster to debug and fix the</DIV>
<DIV>problem.</DIV>
<DIV> </DIV>
<DIV>Regards</DIV>
<DIV>uma</DIV>
<DIV> </DIV>
<DIV>> > > "Ing. Michal Skala" <
michal@orix.sk> 10/14/04 5:50 PM > > >
</DIV>
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>I have attached the full source.</DIV>
<DIV> </DIV>
<DIV>And here is the full error output:</DIV>
<DIV> </DIV>
<DIV>Server error in '/poll' application</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Description: Error processing request. </DIV>
<DIV>Error Message: HTTP 500. </DIV>
<DIV>Stack Trace: System.Data.SqlClient.SqlException: 'int' is not a</DIV>
<DIV>recognized CURSOR option.</DIV>
<DIV>in < 0x0011b>
System.Data.SqlClient.SqlConnection:ErrorHandler</DIV>
<DIV>(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)</DIV>
<DIV>in < 0x00069> (wrapper delegate-invoke)</DIV>
<DIV>System.MulticastDelegate:invoke_void_object_TdsInternalErrorMessageEventArgs</DIV>
<DIV>(object,Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)</DIV>
<DIV>in < 0x00031>
Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage</DIV>
<DIV>(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)</DIV>
<DIV>in < 0x00056>
(wrapper remoting-invoke-with-check)</DIV>
<DIV>Mono.Data.Tds.Protocol.Tds:OnTdsErrorMessage</DIV>
<DIV>(Mono.Data.Tds.Protocol.TdsInternalErrorMessageEventArgs)</DIV>
<DIV>in < 0x00276>
Mono.Data.Tds.Protocol.Tds:ProcessMessage</DIV>
<DIV>(Mono.Data.Tds.Protocol.TdsPacketSubType)</DIV>
<DIV>in < 0x00052>
(wrapper remoting-invoke-with-check)</DIV>
<DIV>Mono.Data.Tds.Protocol.Tds:ProcessMessage</DIV>
<DIV>(Mono.Data.Tds.Protocol.TdsPacketSubType)</DIV>
<DIV>in < 0x0015f>
Mono.Data.Tds.Protocol.Tds:ProcessSubPacket ()</DIV>
<DIV>in < 0x00050>
Mono.Data.Tds.Protocol.Tds:NextResult ()</DIV>
<DIV>in < 0x00089>
System.Data.SqlClient.SqlDataReader:NextResult ()</DIV>
<DIV>in < 0x0005d>
(wrapper remoting-invoke-with-check)</DIV>
<DIV>System.Data.SqlClient.SqlDataReader:NextResult ()</DIV>
<DIV>in < 0x00122>
System.Data.SqlClient.SqlDataReader:.ctor</DIV>
<DIV>(System.Data.SqlClient.SqlCommand)</DIV>
<DIV>in < 0x00056>
(wrapper remoting-invoke-with-check)</DIV>
<DIV>System.Data.SqlClient.SqlDataReader:.ctor</DIV>
<DIV>(System.Data.SqlClient.SqlCommand)</DIV>
<DIV>in < 0x000a2>
System.Data.SqlClient.SqlCommand:ExecuteReader</DIV>
<DIV>(System.Data.CommandBehavior)</DIV>
<DIV>in < 0x00054>
(wrapper remoting-invoke-with-check)</DIV>
<DIV>System.Data.SqlClient.SqlCommand:ExecuteReader</DIV>
<DIV>(System.Data.CommandBehavior)</DIV>
<DIV>in < 0x00012> </DIV>
<DIV>System.Data.SqlClient.SqlCommand:System.Data.IDbCommand.ExecuteReader</DIV>
<DIV>(System.Data.CommandBehavior)</DIV>
<DIV>in < 0x000be>
System.Data.Common.DbDataAdapter:Fill</DIV>
<DIV>(System.Data.DataSet,int,int,string,System.Data.IDbCommand,System.Data.CommandBehavior)</DIV>
<DIV>in < 0x00045>
System.Data.Common.DbDataAdapter:Fill</DIV>
<DIV>(System.Data.DataSet)</DIV>
<DIV>in < 0x000f6>
Test.App.Auth:Course_Show ()</DIV>
<DIV>in < 0x00016>
ASP.login_aspx:UpdateView ()</DIV>
<DIV>in < 0x0000e>
ASP.login_aspx:Page_Load (object,System.EventArgs)</DIV>
<DIV>in < 0x00069> (wrapper delegate-invoke)</DIV>
<DIV>System.MulticastDelegate:invoke_void_object_EventArgs</DIV>
<DIV>(object,System.EventArgs)</DIV>
<DIV>in < 0x00086>
System.Web.UI.Control:OnLoad (System.EventArgs)</DIV>
<DIV>in < 0x00024>
System.Web.UI.Control:LoadRecursive ()</DIV>
<DIV>in < 0x00198>
System.Web.UI.Page:InternalProcessRequest ()</DIV>
<DIV>in < 0x000c2>
System.Web.UI.Page:ProcessRequest</DIV>
<DIV>(System.Web.HttpContext)</DIV>
<DIV>in < 0x002eb>
ExecuteHandlerState:Execute ()</DIV>
<DIV>in < 0x00084> StateMachine:ExecuteState</DIV>
<DIV>(System.Web.HttpApplication/IStateHandler,bool&)</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Hello,</DIV>
<DIV> </DIV>
<DIV>I have problem with running asp.net page in mono, that connect to</DIV>
<DIV>MS-SQL db on windows computer. Mono is installed on linux. This is an</DIV>
<DIV>error, that is throwed:</DIV>
<DIV>System.Data.SqlClient.SqlException: 'int' is not a recognized CURSOR</DIV>
<DIV>option</DIV>
<DIV> </DIV>
<DIV>I have created a small application (one file, only login). This</DIV>
<DIV>application is on linux server with mono. This small application uses a</DIV>
<DIV>small library, that generated SqlCommand a than runs a stored procedure</DIV>
<DIV>on MS-SQL server. The library uses System.Reflection namespace (in</DIV>
<DIV>attachment).</DIV>
<DIV> </DIV>
<DIV>When this small application run very well on .NET Framework and IIS on</DIV>
<DIV>Windows. But, I don't know, who is the problem in Mono.</DIV>
<DIV> </DIV>
<DIV>Thank's for help me.</DIV>
<DIV> </DIV>
<DIV>Michal</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>__________ Informacia od NOD32 1.893 (20041013) __________</DIV>
<DIV> </DIV>
<DIV>Tato sprava bola preverena antivirusovym systemom NOD32.</DIV>
<DIV>http://www.eset.sk </DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks for help me.</DIV>
<DIV>Michal</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>__________ Informacia od NOD32 1.895 (20041014) __________</DIV>
<DIV> </DIV>
<DIV>Tato sprava bola preverena antivirusovym systemom NOD32.</DIV>
<DIV>http://www.eset.sk</DIV>
<DIV> </DIV>
<DIV> </DIV></BLOCKQUOTE></TD></TR></TBODY></TABLE></FONT></DIV>
<DIV>
<P><FONT face=Tahoma size=2>= = = = = = = = = = = = = = = = = = = = =
=</FONT></P></DIV></BODY></HTML>
--=====003_Dragon555784873818_=====--