473,473 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Oracle Connection Error in C# code

kirubagari
158 New Member
Expand|Select|Wrap|Line Numbers
  1.   <add key="DB_CONNECTION_STRING1" value="User Id=cimmgr;Password=cimmgr;Direct=true;Data Source=cimdev.world;Port=1521;SID=cimdev"/>
Expand|Select|Wrap|Line Numbers
  1.       public void InsertintoDB()
  2.         {
  3.  
  4.             string strSQL = "";
  5.             string strDBType = System.Configuration.ConfigurationManager.AppSettings["DBType"];
  6.             string strConn = System.Configuration.ConfigurationManager.AppSettings["DB_CONNECTION_STRING1"].ToString();
  7.             string strInsertTableName_Sql = "CIMMGR.[dbo].ANSDATA";
  8.             string strInsertTableName_Ora = "CIMMGR.ANSDATA";
  9.             string strdatetime = "";
  10.  
  11.  
  12.             strSQL = "insert into " +
  13.             "ANSDATA " +
  14.             "(EQID,CHAMBERID,MEMO,MESSAGE, reporttime, parameterid, ruleid, algorithmvalue, rulename, wafer, alarmaction, runreuslt) " +
  15.             "Values('F1PGAM04', " +
  16.             "'CHA', " +
  17.             "'Sensor Alarm : Alarm','Sensor Alarm : {FDC SEC Alarm(Mean)} EQID=F1PGAM04,CH=CHA,Recipe=ST2SN6.1,Lot=LGQ50083.1,SVID=SIH4_TOP,LCL=6,UCL=8,Value=9.00667647058824', " +
  18.             "to_date('2012-12-21 16:31:42','YYYY-MM-DD HH24:MI:SS'),'MFC3_Flow','75545','9.00667647058824', " +
  19.             "'Testing Rule','LGQ50083.1_0','##INHIBIT_TOOL##','ALARM_SEND_OK') ";
  20.  
  21.             DbProviderFactory rfPF = DbProviderFactories.GetFactory(strDBType);
  22.  
  23.             if (rfPF != null)
  24.             {
  25.                 DataSet DS = new DataSet();
  26.                 IDbConnection rfConn = rfPF.CreateConnection();
  27.                 rfConn.ConnectionString = strConn;
  28.                 IDbCommand rfCom = rfPF.CreateCommand();
  29.                 rfCom.CommandText = strSQL;
  30.                 rfCom.Connection = rfConn;
  31.                 IDbDataAdapter rfDa = rfPF.CreateDataAdapter();
  32.                 rfDa.SelectCommand = rfCom;
  33.                 rfConn.Open();
  34.                 rfDa.Fill(DS);
  35.  
  36.                 DS.Tables["Table"].TableName = "ANSDATA ";
  37.  
  38.                 rfCom.ExecuteNonQuery();
  39.                 rfConn.Close();
  40.             }
  41.  
  42.  
  43.  
  44.         }
Hi Experts,
Attached is my code.I encounter error ORA-12545: Connect failed because target host or object does not exist when trying to open the connection.Do i need to do anything else in order for me to connect to the server
When i try to tnsping it is running fine and im getting an OK(130) message.
So where exactly am i going wrong
Thanks
Dec 28 '12 #1
1 2683
PsychoCoder
465 Recognized Expert Moderator Contributor
That error is telling you that the address provided doesn't exist, meaning something in your connection string isn't correct. I always use ConnectionStrings.com for showing what a connection string for a given db should look like, in this case Oracle.
Jan 3 '13 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: JWM | last post by:
I am trying to implement Oracle connection pooling for the following code, which was written by someone else. Here is my main question -- this java file creates code that is executed every hour,...
2
by: wolverine1654 | last post by:
I have an application that we are moving to a 2003 server using IIS6. Currently, it works fine with IIS5 on a NT server. When I try to log into the application and connect to an Oracle DB, I get...
3
by: Alex Chan | last post by:
Hi All, I know this might not be an appropriate newsgroup for this question. I have tried to search in OTN but seems no good solution exists. Just see any developers face similar problem before...
8
by: Jack | last post by:
Dim oOracleConn As OracleConnection = New OracleConnection () oOracleConn.ConnectionString = "Data Source=FTEST920;uid=master_schedule;pwd=dragons1;" oOracleConn.Open() This is an ASP.Net...
0
by: Parveen | last post by:
I'm using VB.NET as a front-end for an application that uses an Oracle database. At one point in my code I insert a record into a table in my Oracle database. I then call a function in another...
1
by: mafas | last post by:
Hi all, please assist. am trying to connect to an iracle application and am getting error messages as below ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist SVR4...
5
by: barrathi | last post by:
Hai all, when my developers run the application(large application report module) at that time one error will come it shows both database and also application error no :1040 too many...
1
by: suba1984 | last post by:
Dear friends, I tried to open a oracle connection in vb.net 1.1. but i couldn't open the connection.the following error is encount in the application. I am using SQLPlus as a database this is...
1
by: ashwah | last post by:
Hi there, I have made a few bit of code in VBA in the past connecting to Access databases but this is my first attempt to connect to an Oracle DB. My code is as follows, and it seems to fall down...
1
by: Dilip1983 | last post by:
Hi I am getting following error while joining flow of data from a file and table using Abinitio Component. select...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.