Object reference not set to an instance of an object
-
- Posts: 11
- Joined: Fri 10 Mar 2006 09:53
Object reference not set to an instance of an object
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?
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?
-
- Posts: 11
- Joined: Fri 10 Mar 2006 09:53
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]
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]
-
- Posts: 11
- Joined: Fri 10 Mar 2006 09:53
actually, is encapsulated in Topobse.Data.Provider.Connection, pls see code blow: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.
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.
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;
}
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;
}
Target Object Not Found
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.