Page 1 of 1

Length cannot be less than zero. Parameter name: length

Posted: Tue 18 Jan 2005 20:57
by R. Santana
Hello,

I'm receiving this error:

Code: Select all

Server Error in '/' Application.
--------------------------------------------------------------------------------

Length cannot be less than zero. Parameter name: length 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentOutOfRangeException: Length cannot be less than zero. Parameter name: length

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[ArgumentOutOfRangeException: Length cannot be less than zero.
Parameter name: length]
   System.String.Substring(Int32 startIndex, Int32 length) +172
   CoreLab.Oracle.Oci.a(String A_0, String A_1) +99
   a.c.q.l() +546
   a.c.q..ctor(Boolean A_0, Boolean A_1, Boolean A_2) +56
   a.c.d..ctor(i A_0) +325
   a.c.k.a(DbConnectionOptions A_0, Object A_1, DbConnectionBase A_2) +37
   CoreLab.Common.DbConnectionFactory.a(DbConnectionPool A_0, DbConnectionOptions A_1) +37
   CoreLab.Common.DbConnectionPool.a() +44
   CoreLab.Common.DbConnectionPool.GetObject() +343
   CoreLab.Common.DbConnectionFactory.a(DbConnectionBase A_0) +77
   CoreLab.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection) +276
   CoreLab.Common.DbConnectionBase.Open() +34
   CoreLab.Oracle.OracleConnection.Open() +23
   System.Data.Common.DbDataAdapter.QuietOpen(IDbConnection connection, ConnectionState& originalState) +44
   System.Data.Common.DbDataAdapter.FillFromCommand(Object data, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +304
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +77
   System.Data.Common.DbDataAdapter.Fill(DataSet dataSet) +38
   mundocat._default.Page_Load(Object sender, EventArgs e) in z:\default.aspx.cs:29
   System.Web.UI.Control.OnLoad(EventArgs e) +67
   System.Web.UI.Control.LoadRecursive() +35
   System.Web.UI.Page.ProcessRequestMain() +750

 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032 
when I try to open a connection to the database, but the connection is configured perfectly and it works in design time.

Anybody knows what this error means?

My code is as simple as the following:

Code: Select all

		private void Page_Load(object sender, System.EventArgs e)
		{
			if (!Page.IsPostBack)
			{
				con.Open();
			}
		}
The breaking point is [con.Open();] line.

Thanks!

Re: Length cannot be less than zero. Parameter name: length

Posted: Wed 19 Jan 2005 10:27
by Oleg
Please specify your connection string.

Posted: Wed 19 Jan 2005 10:40
by R. Santana
I tried with:

Code: Select all

Password=xxxx;User Id=xxxx;Server=xxxxxxx;
and

Code: Select all

User ID=xxxx; Password=xxxx; Data Source=xxxxxxx;
and

Code: Select all

User Id=xxxx;Password=xxxx;Server=lstxxxx_xxserver;Connection Timeout=15;
Is possible that my listener name affect to te connectionstring because it contains the word "server"?

Thanks

Re: Length cannot be less than zero. Parameter name: length

Posted: Fri 21 Jan 2005 12:13
by Oleg
What is your version of Oracle Client?
What is the version of oci.dll file. This exception can be raised if file oci.dll doesn't have version.

Posted: Fri 21 Jan 2005 12:17
by R. Santana
I have Oracle 10g Client installed on my machine. oci version is 10.1.0.2.0

Re: Length cannot be less than zero. Parameter name: length

Posted: Fri 28 Jan 2005 08:37
by Oleg
Check the value of environment variable PATH. It might include path to BIN
directory at Oracle Client.
Does this directory have end '\? Please send us the value of your PATH variable.

Posted: Thu 10 Feb 2005 19:11
by R. Santana
I didn't reveice any solution to this error. Can you help me please?

Posted: Fri 11 Feb 2005 16:12
by Oleg
Try to test this problem with OraDirect 3.0 beta.

Posted: Fri 11 Feb 2005 17:39
by R. Santana
with 3.0 Beta works fine. But I bought 2.50 and it doesn't work with it. What can I do?

Regards

the same error

Posted: Tue 01 Mar 2005 04:34
by mart
I have the same error, pleased respose, a work aroung.

Thanks

lenght error is a security problem

Posted: Fri 04 Mar 2005 05:39
by mart
Hi,

This is a security problem, make sure the user id 'aspnet', have the necesary right on the 'c:\oracle\ora*' directory... On my case, I include this user, on the administrator group (local administrator), of my machine....

Good luck