Simplest way to connect to Oracle - c#

I am making a desktop application in C#. What's the simplest way to connect to Oracle? The application is a very simple one and it will only run a few SELECT and INSERT statements.
Don't want to install some big drivers or clients on my machine. Anything that will make my application up and running quickly is fine.

You should use the Oracle Managed .NET driver. It doesn't require OCI to be installed which makes it very easy to deploy. Another nice thing of it, is that is supports both 32 and 64 bit (the unmanaged version of the ODP.NET driver didn't).

The simplest way is probably to use the
Microsoft OLE DB Provider for Oracle
which is apparently included in WDAC (Windows Data Access Components) and, thus, in certain versions of Windows. I couldn't find a comprehensive list, though, you might have to verify that it works on the target OSes of your application yourself.
Do note, though, that this simplicity comes at a price -- the driver is deprecated:
This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Instead, use Oracle’s OLE DB provider.

I would recommend you use standalone approach as described here.
In short, you just need few necessary files from the Oracle Client to reside in the bin folder of your application, to work with Oracle database. There is no need to install heavy Oracle client or use other providers that may not exist on some machines.

Related

Deploy sql+winforms application on Linux/Ubuntu while development server is still Windows

I have a very limited knowledge for Linux/Ubuntu platform.
There are some requirements coming though for me to deploy a version of our desktop application on either of the above platforms.
With the context, I have the following queries in my mind:
Could the same code can run on windows using the MONO/MONO IDE and I can compile the output to the OS specific?
OR assuming there are certain changes I must make to run them on different OS, what could be the best way to deploy it on Linux/Ubuntu?
OR Is it possible to keep the same code under windows development, however can be deployed on Linux/Unix environment?
SQL wont work on Unix so you'll need to convert that first.
Yes thats the way to go.
You need to do step 1 to work out if there are required changes specific to OS's.
Assuming that everything required by the assembly is supported by Mono, you shouldn't have to do anything - it should already be binary compatible. That's one of the points of IL :)
If you do find some things that aren't supported by Mono, suggest you have a Unix branch of code.

Can C# natively talk to Websphere and call wsadmin commands?

I'm writing a small c# console application that needs to interogate Websphere Application Server ND (6.1) to retrieve a list of installed apps.
I can easily do this from the command line using the wsadmin command, but don't really want to launch wsadmin from my c# app.
Is there a way to natively get c# to talk to Websphere and get this sort of information ?
Wsadmin is just a scripting interface for JMX and everything you can do with it can be done with RMI and SOAP. For C# users that means querying for Management Beans via SOAP.
However there are no turn-key solutions available. What has been suggested before has been at least taking a look at the ws-jmx-connector and implementing your own library. You could probably easier just capture one of those queries with ie. SoapUI and replay the SOAP calls. This probably means too much work and that's probably also why there are no ready solutions.
Also, you could just read the XML files that describe the (properly) installed WebSpehre Application Server applications. That is probably much easier, and works just fine. Take a look at the server profile directory. You should see a directory called config, then under it cells, your management cell's name and under that you will find XML files that actually contain every setting you see in the management console. They are well parseable by the standard .NET libraries and a few of those will contain application lists. Take a look at serverindex.xml for instance.

Warn user of .NET Framework requirements

So I have an app (tool) that uses .NET 3.0. When run on a machine that only has .NET 2.0 (like the default Server 2008 R2 install) it crashes miserably.
What I've seen so far is that people are using a shunt that will first check the .NET version.
Is there a way to build it or add some manifest somehow so that the user is warned of this problem (and hopefully be prompted to install .NET)?
I know this can be solved by an installer, but I have requirements that need it to be a standalone executable. (Ok this is hard to explain, but it's related to the a device driver. The tool comes with the driver, but the user shouldn't be forced to install .NET 3.0 if they won't use the tool.)
I just need to stop at the point where a cryptic "application has failed with exception 0xe0434f4d" message and at the very least give the user some idea of what happened.
Have not tested this, but this article about framework detection tells how you could detect the framework version from code. I'm not sure where your application fails and if injecting checks like this could solve your problem, but if you cannot use this in your app, you could perhaps create a small "starter app" in old .net 2.0 that performs these checks and then either tells the user to upgrade or starts your "real" app?
As I said, haven't tested this approach, it's just off the top of my mind.
This never makes any sense to me. Where are you going to stop? Are you going to make sure as well that the user doesn't install it on Windows 98? That the machine has enough RAM? That the user account has enough privileges?
Software vendors publish system requirements. You always quote the lowest supported Windows version, minimum amount of RAM, required disk space, minimum browser version, etc. Minimum .NET framework version belongs in that list too. The intention of this list is clear: don't expect it to work properly if you don't meet the requirements. If you do it anyway, it is your problem, not mine.
This is different for a consumer-level app. But when you install to Windows 2008 server, you are not writing a consumer app.

Hosted Source Control?

I'm working on a few closed-source projects. (Small ones.) I don't want to share the code of these projects. But I do want to have an easy-to-install version control system that's easily installed on my web host.
I don't have administration rights on this web host so I can't just run a setup.exe on the remote system. Basically, the only way to install something is by just creating a database and copying files to the server and maybe a bit more by using a Plesk control panel.
I can choose between two hosts: one using Linux with MySQL and the other Windows 2008/IIS7 with SQL Server 2005. The Windows host has my preference, since it provides the most disk space.
So, what options do I have? (Doesn't have to be free, although I do have a limited budget.)
I can have physical access to both hosts to install some additional software but it means traveling about 5.000 KM to the server room. I can also tell someone at the location of the server to install it for me, but that's quite expensive. I could just find another company to host this for me but I like my current servers/hosts. So that's why I'm looking for a solution that I can simply upload to the server.
I would highly recommend both Assembla and Unfuddle. They offer different types of version control (SVN, GIT, etc.), as well as ticket management, messaging between teams, wikis, and many many other tools that I haven't gotten into yet.
I have been using Assembla and have found it to be very intuitive and offer great features, such as automatic integration between the ticketing system and the version control system. I use the free version and just hope that no one browses/steals my code until that particular project gets to the point where I should consider paying their small fee to guard it :)
Do comment on what you choose to do!
I run Subversion on Dreamhost for less than $10/month. Most of my projects are pretty small so far--I know they don't always appreciate large amounts data as non-web-accessible storage. It is first a web host, not a file host. However, its pretty easy to set up SVN repositories in their admin interface and then you have an easy svn+ssh connection.
Of course, since it is a web host it's easy to install Trac (they even have a 1-click install for it) or some other piece of software as well.
What is preventing you from using hosted services like:
Bean Stalk
Project Locker
They offer a range of accounts including those that are free.

Best continuous integration setup for multi-platform development

What is the best continuous integration setup for a Devleopment department that codes in multiple environments?
At my company we write some code in C# and some in Java, I've previously used CC.Net but I've never done CInt with Java.
I'm aware of Continuum and was recently told about Hudson, but I've never used either.
Would it be better to use two CInt services one for each platform or to use a single one for both?
Why don't you try Team City from JetBrains? It is both for Java and C# and Professional version is free up to 20 user accounts and 3 build agents.
You could simply use the Java version of CruiseControl and have two setups.
As you already know how to use CC.Net and CC.NET can run any build task that outputs XML. Why not just use CC.NET with ant for your java code as well as your C# code.
Or do you need to build on none Windows machine? CC.NET may work with mono, I have not checked.
Remember that any continuous integration setup that compiles all your code and run your unit tests give you great benefits. On most projects having the perfect setup only give a smaller improvement over having a continuous integration setup that works. So I would just pick something you are happy with and start using it now.
Imho, its almost alway better to use one CI for all platforms you plan to deploy to - easier to sort out problems that way.
shameless plug: try Bamboo, the CI server from Atlassian. Its one click setup, built-in support for Ant and Maven and works on all platforms with JVM. It can also do distributed builds on different platforms.
It also integrates with Atlassian Jira Issues Tracker and Fisheye Code Repository Browser if you have those products.
Hudson. I've used it for both .NET and Java projects and it works well to have both platforms using the same continuous integration server.
Note this assumes you want to build the same code on multiple platforms. Hardware has gotten cheaper so use virtual machines or multiple physical servers I'd go with virtual machines and just buy one powerful server to run them on but if you have a lot of old mid range hardware that may be a cheaper option. Set up a main source control repository on one server, and set up servers with the client operating systems you want to build for. For example have a svn server containing your operating system of choice, a Linux server to do Linux builds and a Windows server to do Windows builds. Then just install what ever continuous integration software works best for the given code base and operating system.

Categories

Resources