How can I connect Mobile Ce 5.0 app with Oracle database???

I made windows mobile app in visual studio 2005 and don't know how to connect with oracle database. I was made console app and successfully connect  with oracle db. I was using Oracle.DataAccess and System.Data.OleDb connection.But I can't use that in windows mobile app. There's only sql.client and such staff, there's nothing that I can use for connection to oracle database.

Please can you tell me what should I use to connect to oracle database.I'm also try to copy SystemData.dll and Oracle....dll to my app properties but assambley don't recognized it.
hrki1991Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

slightwv (䄆 Netminder) Commented:
Never created a mobile app so this may be way off base.

You might try the new .Net Managed Client for Oracle:
http://www.oracle.com/technetwork/issue-archive/2014/14-mar/o24odp-2147205.html

It is 100% .Net code and there isn't a need for any Oracle Client install.  I'm using it for .Net web apps and am pretty happy with it.
hrki1991Author Commented:
I tried that too. But it's imposible to add that reference in my PocketPc. I can manipulate witha that in windows app form and console, but not in pocket pc. :(
Capture.PNG
slightwv (䄆 Netminder) Commented:
Not knowing anything about Windows CE makes things difficult.

Can you not compile it on a regular Windows box and deploy it to the CE machine?

I just copy the Oracle DLL into the bin folder of the app and can copy the app around all day.  Again, I deal with .Net web apps.
SolarWinds® IP Control Bundle (IPCB)

Combines SolarWinds IP Address Manager and User Device Tracker to help detect IP conflicts, quickly identify affected systems, and help your team take near instantaneous action. Help improve visibility and enhance reliability with SolarWinds IP Control Bundle.

hrki1991Author Commented:
Thanks for your help anyway. I'll resolve my problem next week, or I'll try :) .

I have one more problem. I'm connected thru vpn, and my oracle sql developer to database.click
 Everythin working ok. But when I used string

string ConnectionString = "Data Source=(DESCRIPTION =(ADDRESS_LIST =(ADDRESS= (PROTOCOL = TCP)(HOST =<HOSTNAME(IP ADRESS)>)(PORT = 1521)))(CONNECT_DATA = (SERVER =<SID>)(SERVICE_NAME =<SID>)));Password=<PASS>;User ID=<USER>;"

Open in new window


there's always error: System.Data.OracleClient.OracleException: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I'm using similar and exactly string code to connect to database I created, on this computer, both codes working. But when I try connect to that base there's always error.


My vpn are set, and I can access to that database thru oracle sql developer. I can't find my mistake, becouse I'm only junior developer, extra junior in c# and oracle database

P.S. When I'm not connect to vpn, my console app work longer, and then send me error for connection time out(logical) but when I'm connected he show me error message very fast, message from above
hrki1991Author Commented:
When I try tnsping to that IP i get this

Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTO
COL=TCP)(HOST=xxx.xxx.xxx.xxx)(PORT=1521)))
OK (700 msec)
hrki1991Author Commented:
I also edti my tnsnames.ora file...but error is still there...
slightwv (䄆 Netminder) Commented:
I'll try to bring in some more Experts.

>>and then send me error for connection time out

If it is an ORA-12170, 99.99% of the time it is a firewall issue.  Something is blocking the high level ports.

>>ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

I set up my .Net connect strings in my web.config.  I also still use the tnsnames.ora connection syntax instead of EZConnect.

Here is my connection information from one of my web.configs.  Starting in 11g, the passwords are case sensitive so I use double quotes around it:
<add key="ConnectionString" value='User Id=scott;Password="tiger";Data Source=ORCL;Max Pool Size=300' />
hrki1991Author Commented:
How is even possible that I can't coonnect to 1 of 3 databases...only diferece is that db have IP in hostname, it isn't localhost like usualy.

And how is even possible that I can acces that db from my oracle sql developer, but can't from code in c# ???
slightwv (䄆 Netminder) Commented:
>>that I can acces that db from my oracle sql developer, but can't from code in c# ???

Easy.  SQL Developer may or may not use the tnsnames.ora file.  An installed Oracle client isn't required for SQL Developer.  It can use the JDBC Thin connection.

>>only diferece is that db have IP in hostname, it isn't localhost like usualy.

Networking/firewall?

I ALWAYS use IP address in my Oracle config files.  Weird things can and DO happen if you use hostname.
hrki1991Author Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for hrki1991's comment #a40929492

for the following reason:

l
slightwv (䄆 Netminder) Commented:
Please post the solution so others that might have this issue know what to do.
hrki1991Author Commented:
I don't have solution yet. :(

things that I does for now are that I set up my odbc driver. Now I can connect to oracle database with my oracle client(odbc)

To do that, and reason for ORA-12514: TNS:listener does not currently know of service requested in connect descriptor is that everyone should setup:
---Control Panel->System->Advance system seting->Advanced->Enviroment Variables->and there on sytem variables create new with name(TNS_ADMINISTRATOR) with path to your file with tnsnames.ora tnsnames.ora.bak and sqlnet.ora. In tnsnames.ora you define your service name etc. . I don't know if tnsnames.ora.bak is necessary but for me it's working fine(driver in odbc in control panel).

Now I can connect to oracle db thru Visual Studio data connection and odbc and pretty much everything in this world but not with only one thing that I need. When I try connect via OdbcConnection in my code there still error

Capture.PNG
hrki1991Author Commented:
I forgot to write.

I can connect with this string
String c = "Provider=MSDAORA;Data Source=xxx;User ID=xxx;Password=xxx;Unicode=True";
OleDbConnection conn = new OleDbConnection(c);

my ODBC WORKING!!!!, I tried it in control panel, but don't working in my code!!!!
slightwv (䄆 Netminder) Commented:
>>create new with name(TNS_ADMINISTRATOR)

The correct variable name is TNS_ADMIN not TNS_ADMINISTRATOR.

>>Provider=MSDAORA

That is using the deprecated Microsoft access provider.  That only sits on top of the Oracle Client which is why it was deprecated.  You really shouldn't use it and go with native Oracle drivers.

>>I don't know if tnsnames.ora.bak is necessary but for me it's working fine

Not necessary.  Something or someone created a backup file.

>>When I try connect via OdbcConnection in my code there still error

Make sure the Bitness of everything matches.  64Bit Windows has two ODBC administrator tools.

https://support.microsoft.com/en-us/kb/942976

If the app is 32Bit, you need the 32Bit Oracle client installed and your DSN needs to be set up with the 32Bit ODBC admin tool.
hrki1991Author Commented:
>>If the app is 32Bit, you need the 32Bit Oracle client installed and your DSN needs to be set up with the 32Bit ODBC admin tool.

I olso think that's the problem. I have 64 bit PC, 64 bit driver and 32 bit VIsual Studio. In VS you can chose if you want debug with x64 or x86.

But I'm also install 32bit VS on my 32 bit virtual machine, with 32 bit driver, everything 32 bit and there's still same mistake.

I'm sorry for TNS_ADMINISTRATOR, I was so tired yesterday that didn't notice spelling mistake
slightwv (䄆 Netminder) Commented:
You have tried many things with many variations.

Let's pick one and get that working.  No more trying several things at once.  It is confusing both of us.

I'll let you decide.  What once thing do you want to connect to what?

Once you've decided that:
What setup do you currently have?
What is the error you are receiving?
hrki1991Author Commented:
Yes, we should go back to begin. I must make app on windows mobile, it would be app for scanning product. That app should comunicate with oracle database via wi-fi on regular daily base.

My mistake is that I choose windows mobile form for developing that app. My thinking is that is tooooo complicate to develope such app in this form. They don't support odbc etc.

I am ready to hear solutions what type of app should I use for that. Some web app, for windows mobile????

I'm using vs 2008 becouse that is old windows mobile device/pocket pc with .net framework max 3.5


I'm new in all this and for me pocket pc and win mobile app 6.5 are similar. But i should make app which would work on almost every windows mobile device(scaners etc. Not mobiles)
slightwv (䄆 Netminder) Commented:
From a security standpoint:

I would NEVER let an app like this talk directly to the database.
I would never let anything talk directly to my database using WiFi.

For security, you want the database as far away from open network connections as you can get it.

This typically involves middleware like a web service.  The end app makes a web service call.  The web service talks to the database.


All that said:
I cannot tell you what development platform you should use.  I know Oracle and some .Net web forms along with some native c.

I cannot say what you need to use to develop a scanning application for Windows Mobile devices.

>> They don't support odbc etc.

I wouldn't use ODBC.  I prefer native drivers.

All that said:
If Windows Mobile supports .Net 3.5, of course I would try to use that because I am familiar with .Net.

If you are going to write code using .Net to talk to an Oracle database, you use ODP.Net as the data provider.

I can help get a 3.5 .Net app talking to a database server.  If you would like, I might even be able to provide a simple console app with the Oracle 12 Managed Driver.

Now, will that work on Windows Mobile?  I have no idea?


I know nothing about Windows mobile and what software will actually run on it.

>>But i should make app which would work on almost every windows mobile device

Cannot help at all here.
hrki1991Author Commented:
>>I can help get a 3.5 .Net app talking to a database server.  If you would like, I might even be able to provide a simple console app with the Oracle 12 Managed Driver.

Thank for help but isn't problem console app. I connected my console app to db.

It's problem win mobile app that f shit haven't a half solution that console app have


>>I wouldn't use ODBC.  I prefer native drivers.

I checked ODP.NET and here is everything that downloading of that have. Still odbc :) .


Oracle Developer Tools for Visual Studio 12.1.0.2.0
              Oracle Data Provider for .NET 4 12.1.0.2.0
              Oracle Data Provider for .NET 2.0 12.1.0.2.0
              Oracle Providers for ASP.NET 4 12.1.0.2.0
              Oracle Providers for ASP.NET 2.0 12.1.0.2.0
              Oracle Database Extensions for .NET 4 12.1.0.2.0 -- for upgrade only
              Oracle Database Extensions for .NET 2.0 12.1.0.2.0 -- for upgrade only
              Oracle Provider for OLE DB 12.1.0.2.0
              Oracle Services for Microsoft Transaction Server 12.1.0.2.0
              Oracle ODBC Driver 12.1.0.2.0
              Oracle SQL*Plus 12.1.0.2.0
              Oracle Instant Client 12.1.0.2.0

Hm, I must decide what type of app should I use. Question: isn't web app available on every device
slightwv (䄆 Netminder) Commented:
>>Hm, I must decide what type of app should I use.

Until you answer that question I don't know how you can move forward with any part of the project.

I've stated my advice from a security aspect above.  You have already figured out the issues with connecting directly to the database from older devices.

Those two things alone should tell you that there might be a better way.

I would seriously look at an N-Tier solution:
Mobile devices talk to some piece of middle-ware (that you write as well) like a web service.  This middle-ware is on a 'supported' platform that can more easily talk to the Oracle database.

>>Thank for help but isn't problem console app. I connected my console app to db.

So, you have a console app that you can copy to the Windows Mobile device and it connects to the database?
or do you mean your Visual Studio machine can connect to the database from a console app?

If it runs on your local PC and not the mobile device, then you need help porting the app from one system to another.  I doubt Oracle is supported on Windows Mobile but that doesn't mean it won't run...

>>I checked ODP.NET and here is everything that downloading of that have. Still odbc :) .

Just because it comes with ODBC doesn't mean you have to use it.  When I say native drivers, I don't mean drivers from Oracle.  I mean drivers that allow code to directly connect.  ODBC sits outside the application no matter what vendor provides the drivers.


I'm using the previous version of this with my .Net websites but I'm sure it hasn't changed much:
Download the ODP.NET, Managed Driver Xcopy version only
http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html


>>Question: isn't web app available on every device

I don't understand the question.

When you say web app, do you mean an app available from a web browser, like an Intranet site?
hrki1991Author Commented:
The idea with web service is good, but then I need one pc for server. That pc would be connected to db, and proced query. Then my console app would writing answers in file. Then that file would be sent on web service.

With my app on windows mobile  I would easy connect to my web service and download file, read from file, do things, write them to another file and then send that file to web service

Is that good theory from me???

The main is that I trying to bypass web service becouse of that onother PC.Only thing becouse I try to make direct access to database on my computer from my windows device is that I don't want that another PC in that hole story.

slightwv thank for your help, should we move this debate to private message???
hrki1991Author Commented:
>>When you say web app, do you mean an app available from a web browser, like an Intranet site?

No I think app that only use browser
slightwv (䄆 Netminder) Commented:
>>No I think app that only use browser

I am confused.  Didn't you just agree with me but say "No"?  Web apps execute inside a browser?
hrki1991Author Commented:
yes, Web apps execute inside a browser

but that you can't connect to that app from another device, only from device where is installed
slightwv (䄆 Netminder) Commented:
>> but that you can't connect to that app from another device,

Understood.  I don't think I ever suggest them for a solution to your problem.  I only stated that I use .Net for web apps.


Personally, I would forget about direct connectivity from the end user device to the database.  I really doubt you will find an Oracle driver that will allow the direct connect from old Windows Mobile/CE/??? days.

I would write an app that talks directly to a middleware server possibly a web service call.  Let that middleware talk to the database.
hrki1991Author Commented:
Hello everyone.

Finnally i have solution for my problem. My problem was: "How to connect windows mobile device 6.5 or less to oracle database with visual studio 2005/2008"

slightwv suggest me to make web service or we can say Three-tiered architecture. God idea, but i was refusing that idea becouse I don't want another PC in whole story or we can say I want two-tired architecture not three.

My solution is to make linked database in sql express. Linked database from oracle database. Then you can connect to that database with SqlClient.

If anyone have any question about that whole proces let me send pm.

Than slightwv for help

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
hrki1991Author Commented:
I find solution on my own
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Oracle Database

From novice to tech pro — start learning today.