Object reference not set to an instance of an object

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Object reference not set to an instance of an object

Post by george_zhu » Fri 10 Mar 2006 10:00

hi,
we use CoreLab.Oracle.OracleConnection.Open() in Asp.Net to access Oracle 10G database, but i got this all the time:

Description: Object reference not set to an instance of an object. Type: System.NullReferenceException Source:CoreLab.Common.Utils.TryParseInt

actually, we use the same function in C# project, and it is no problem, so i donot know why it happened.

any ideas?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Fri 10 Mar 2006 10:18

Can you provide call stack for this problem?

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Mon 13 Mar 2006 01:22

the exception throw while excuting _connection.Open(),
below is the property of _connection, I can access to Database in Sqlplus by inputting this username and password, thanks.

_connection {CoreLab.Oracle.OracleConnection} CoreLab.Oracle.OracleConnection
_dataSource "orcl" string
_password "tbsys_george" string
_pooling false bool
_username "tbsys_george" string
ConnectionString "Data Source=orcl;User Id=tbsys_george;Password=tbsys_george;Pooling=False;" string
ConnectionTimeout 15 int
Database "" string
DataSource "orcl" string


below is the call stack
> Topobase.Data.dll!Topobase.Data.Provider.Connection.Open() Line 411 C#
Topobase.Data.dll!Topobase.Data.Sys.SysConnection.Open() Line 209 + 0x7 bytes C#
Topobase.Forms.dll!Topobase.Forms.Application.Init(String Username = "BAKER", String Password = "", String webMapName = "MapGuide7Web", String webApplicationKey = "WebTUX", String IpAddress = "127.0.0.1") Line 958 + 0xd bytes Basic
Topobase.Forms.dll!Topobase.Forms.WebClient.WebApp.WebLogin(String sessionId = "S6f205422a20a413bb9d3cb024dada99a", String username = "BAKER", String password = "", String Info = "ID:IP:127.0.0.1", String IpAddress = "127.0.0.1", String IdName = "", String browserType = "IE6", String webmapName = "MapGuide7Web", String webApplicationKey = "WebTUX", Boolean showSource = True, Boolean externalLogin = False) Line 27 + 0x18 bytes Basic
[External Code]
Topobase.Web.App.DLL!Topobase.Web.App.Client.Login(System.Web.UI.Page page = {ASP.login_aspx}) Line 110 + 0xe0 bytes C#
App_Web_gcljxsbk.dll!Login.ClientLogin() Line 56 + 0xc bytes C#
App_Web_gcljxsbk.dll!Login.ButtonLogin_Click(object sender = {Text = "Login"}, System.EventArgs e = {System.EventArgs}) Line 39 + 0x7 bytes C#
[External Code]

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 14 Mar 2006 10:10

From your call stack we can see that the exception comes from Topobase.Data.Provider.Connection component. We do not support this component. Refer to corresponding resources for information on those components.

george_zhu
Posts: 11
Joined: Fri 10 Mar 2006 09:53

Post by george_zhu » Fri 24 Mar 2006 03:06

Paul wrote:From your call stack we can see that the exception comes from Topobase.Data.Provider.Connection component. We do not support this component. Refer to corresponding resources for information on those components.
actually, is encapsulated in Topobse.Data.Provider.Connection, pls see code blow:
namespace Topobase.Data.Provider
public class Connection : IDbConnection, ICloneable
{
private OracleConnection _connection = null;
...// other variable definitions
public void Open()
{
try
{
_connection.Open();
}
catch (OracleException e)
{
throw new TBException(e);
}
}
}

so the problem are on your side, in my opinion, can you give an explanation? do it have something to do with our machine variable settings? in other guys's machine, it is okay.
Thank you for your patience.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 27 Mar 2006 15:10

We will make changes in the next OraDirect .NET build to avoid such problem.
Possibly the problem is in IIS configuration. Please try to execute the following function in your code. You must have not-null result.

public void string GetVersion(string ociDll) {
FileVersionInfo verInfo = null;
if (File.Exists(ociDll)) {
verInfo = FileVersionInfo.GetVersionInfo(ociDll);
}
string ociVersionStr = verInfo.FileVersion;
return ociVersionStr;
}

jscally
Posts: 1
Joined: Mon 03 Apr 2006 13:06

Target Object Not Found

Post by jscally » Fri 07 Apr 2006 14:00

:(

I am having the same problem. Also Oracle 10G. When I ran the getVersion Function and empty string is returned.

If this is an IIS configuration problem - what must I change. This has completly stopped us in this project.

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 10 Apr 2006 06:16

Does oci.dll contain version information? Can you see it in properties window in file explorer?

Post Reply