Connecting to an OBDC database from a Xamarin IOS / Visual Studio Mac solution - xamarin.ios

First, I am just getting starting with VS/Mac and Xamarin in general.
This question concerns accessing database servers.
I am attempting to port existing corporate applications to the iOS environment. At the outset of a "Hello World" type app in order to get used to the environment I successfully added a reference to "System.Data". This lead me to easily exposing SQL Server connection options via "System.Data.SQLClient" . No problem so far.
Another requirement of our corporate apps is to connect to a Progress database and the previous method was to utilize a reference to "System.Data.odbc". This is my issue. "System.Data.odbc" does not exist in this environment.
I can switch to a web service if necessary, but I would like to port as much of the original code as possible to start with.
Also, these are closed applications in the sense that they are only available on our corporate network.
In a Windows Forms application i would create a connection similar to this:
odbcConnection cn = new ODBC.connection;
cn.connectionString = blah blah;
cn.open();
And so on...
To those that have developed corporate data access apps in both Windows Forms and Visual Studio/Mac/Xamarin I simply ask: "What am I missing?"
Thanks to each responder in advance.
Earl

Related

Azure Mobile Services on Local IIS rather than IIS Express

OK, I've created an Azure Mobile Services project in Visual Studio 2013.
I run it up as-is, then in the browser I test it by adding a todo item via the simple browser app that seems to get baked into these service projects. It gives me a '201 success' message - brilliant.
I then convert the project from IIS Express to Local IIS as the web host, recompile and try again, and although I get the same smiley face app telling me that everything is OK, when I try and add a todo item I get a 404 error. This is contrary to the Microsoft article that gives these instructions, which clearly says I am able to choose either IIS Express or Local IIS when setting up the project.
My guess is that web.config is missing something when this project runs on the local IIS server.
I'm hoping someone already has a solution before I spend hours trying to work out how to configure IIS for this type of project.
I've already wasted a load of time working through loads of bugs and gotchas with Azure Mobile, and I'm starting to run out of steam - so I'm hoping someone can help me before I go and grab an account at Parse.com
Many thanks in anticipation.
Dean
The easiest approach for your situation might be to just deploy to the cloud, and use that service for your testing. Visual Studio 2013 Update 2 makes it easy to deploy your app and connect to it for remote debugging. It is a little slower than using a local instance, but you are also assured that there will be no surprises when you eventually go live (since you are live the whole time).
That said, we will investigate the issue you are seeing with using IIS directly. Some things you might want to try on your own:
Verify that you can view the web side from your Mac's browser, to make sure that the firewall is letting the requests through.
Try using the "Getting Starting" link from the smiley-face page, to see if the REST endpoints are behaving correctly.

Options for Visual Studio web performance and load test against a remote server

I am new to Visual Studio Web Performance Testing and Load Testing. I am wondering what my options are for testing a remote server? For example, I am planning to deploy a ASP.NET site to Amazon Cloud. Configuration is 2 web front ends, 1 database server behind a load balancer. Can I run a web test/load test connecting to Amazon simply by configuring Visual Studio accordingly? Or do I have to set up a test agent on the web servers and configure that accordingly? I have tested the site locally (my development environment). Can I, instead of pointing locally, point to the url running on Amazon?
I know I can add a computer through LoadTest "Run Settings". Though, I do not think it is as simple as adding the remote server name here.
Yes, you can test against any URL that you can reach from your computer that is running Visual Studio. You simply need to parameterize the host url(s) in your webtest(s). Click the Parameterize Web Servers button in the web test editor toolbar to achieve this. Once parameterized, you can substitute different values by creating the same context parameters in your LoadTest RunSetting. LoadTest context parameters override WebTest context parameters.
Of course, you are still subject to whatever network obstacles and firewall rules that are in your way. For example, you won't be able to hook up to capture Performance Monitor data from the Amazon Cloud servers (or at least I presume that the relevant ports would be blocked).

OLE DB Provider for ODBC Drivers Error "80004005'

I have to move some customer sites from a very old IIS Server to a newer one, and some sites have troubles to work in the correct way. Most of them complain about a failure called:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified.
I've read on the internet that this could depend on missing rights given to the user; other sites states that a Temp folder is missing (I can't imagine that this is right)… There are several other "solutions":
Open the rights for everyone on the server (as someone stated) is not an option for me. Also it is very painful to give explicit rights to every customer (there are several customers which needs the rights).
Do you know an easier solution, a similar way, or an alternative?
That error is nearly always caused by a bad connection string when an ADODB.connection object has its .open() method called.
For example, take the following code:
Dim SqlUsername : SqlUsername = "YOURSQLUSERNAME"
Dim SqlPassword : SqlPassword = "YOURSQLPASSWORD"
Dim ConnectionString : ConnectionString = "DRIVER={SQL Server};SERVER=YOURSERVERNAME;DATABASE=YOURDATABASENAME;UID=" & SqlUsername & ";PWD=" & SqlPassword
Dim db
Set db = Server.CreateObject("ADODB.Connection")
db.Open ConnectionString , SqlUsername , SqlPassword
Note how the connection string includes a driver identifier, in this example that is SQL Server.
Somewhere in your application you'll have an adodb.connection.open() method being called with a connection string, you need to find it, determine the driver being used and install it on your server.
Another thing to keep in mind, some data source drivers are 32bit and if your running your website in a 64bit application pool in IIS you'll need to allow 32bit objects - see this related question on that: Uploading picture after migration from IIS 6.0 to IIS 7.5
I have got the similar issue while working with classic asp and with IBM DB2 ODBC Driver. I do have two websites configured in my local IIS 7.5, Connection.Open is working fine with default web site whereas it does not with the second website, after several configuration changes as per my knowledge and as per sugesions from stackoverflow did not helped me in this case.
What worked for me is to enable (Set to True) the 32bit applications Advanced setting of ASP.NET V4.0 Classic Application Pool.
Application Pools-->ASP.NET V4.0 Classic-->
Advanced Settings--> under General Options double click Enable 32-bit Applications to set to True.
This small configuration may help some one who has the same issue.
Your old server has some ODBC DSN (Data Source Names) defined, and this is how your applications are connecting to the databases. You need to define these on your new server. Look in your server's Control Panel.
For sure now you have solved your problem but nevertheless for knowledge purposes here is what can work:
On top of what #webaware said please follow the steps below on your new server machine:
Go to Control Panel
Administrative Tools
Data Sources (ODBC)
Click System DSN tab
Click the Add button
Look for and select the Oracle in Client driver.
Now type in the Data Source Name, Description, TNS Service Name and User ID
Note: Ask your database administrator for the correct TNS Service name and User ID. You will also need the user id for testing your connection.
Click the Test Connection button
Type in your TNS Service name as the Service Name, User ID as the User Name and the password of the User ID
Click the Ok button
Your connection should be successful now.
I had the same problem after update Control Panel Plesk 12.5 to Plesk Onyx 17.5.3 and see updated ODBC Driver to 5.3.
To resolve the problem I changed ( 5.1 ) to ( 5.3 Unicode Driver ) in connection string.
Change this :
Conn.Open "DRIVER={MySQL ODBC 5.1 };SERVER=localhost; DATABASE=psa; UID=admin;PASSWORD=mypassword;Port=8306; OPTION=3"
To :
Conn.Open "DRIVER={MySQL ODBC **5.3 Unicode Driver**};SERVER=localhost; DATABASE=psa; UID=admin;PASSWORD=mypassword;Port=8306; OPTION=3"
Be sure to place the connection code at the top of the page vs bottom. That fixed my issue with this error.
The driver is not found because these drivers are not configured or registered in the system, I too got such an error when I run a asp page website in localhost. The same page was running smoothly in the host server.
To register, go to Microsoft ODBC Administrator -> SYSTEM DSN tab -> Add your driver by clicking 'configure' button. Hope this helps.
For me it was just a missing ";" after database name in connection string
This was not related to permissions. You are may be you defining database connections that explicit referenced a specific version of the mysql ODBC driver.
You will have to Update your connection strings.
i have same error when use asp classic script , MySQL and Plesk control Panel (windows)
You can Enable 32-bit applications in Plesk :
Go To Plesk Control Panel => Hosting & DNS => Dedicated IIS Application Pool for Website => Enable 32-bit applications

Cannot connect to FoxPro Database from IIS 7.5

I am currently having serious issues connecting to a FoxPro database using an ODBC connection from IIS7.5
The database is on another machine than the IIS server and is accessed via a fileshare.
When I call the webpage from IE on the IIS server everything works fine. When I call the webpage from another machine I get a '[Microsoft][ODBC Visual FoxPro Driver]Cannot open file' error.
The application pool runs as a domain user.
When I run ProcMon on the IIS Server and call the page, when it is called from the IIS Server it accesses the offending file and then a whole bunch of other FoxPro files for that database.
When I run the page from another machine, I get an ACCESS DENIED error when it tries to access the first file.
It is a CreateFile call for a file called Comp_W.DBC that fails.
I checked and it is the same user that is invoking these calls to the fileshare so it is not differing credentials that is causing the problem. I even went as far as making the app pool account a domain admin to see if that might sort out the issue but still the same problem.
I cannot move the database onto the same server as IIS. I have tried to run the web application on the same server as the FoxPro database but I hit different issues to do with the fact that OWA runs on that server, and the 32bit ODBC driver causes conflict with an OWA dll that is loaded as a global module. I really need it to run IIS on a separate server from the FoxPro database.
The server(s) do not seem to be running kerberos as the delegation tab is not present when you administer users.
Any help would be greatly appreciated.
James :-)
I'd use the Visual FoxPro OLE DB driver instead of ODBC, because it's newer, faster and won't conflict with OWA. That would let you move it onto the IIS server.
Past experience suggests that you haven't given the IIS user permission to access the folder where the DBFs live. When you run IE on the local machine, you're passing the credentials right through -- when you run it on another machine, I believe the anonymous user rules come into play. (Been a while since I had to debug this one, take it with a grain of salt.)

Setup Project - Allow multiple installation of the same Windows Service

I have a question regarding to Setup Projects in .Net (c# language, Framework 4.0):
I made a setup project for a Windows Service, on the installation wizard, the user must input the name of the Windows Service as it would be installed. The setup program also creates a shortcut to the Uninstall program in case the user wants to remove that Windows Service.
The question is: how to let the user run the same setup program several times specifing different service name?
This behaviour could be required because the windows service is a socket consumer that connects to a server and retrieves data; to take advantage of the server capabilities the user could install the same windows service multiple times pointing to a different port on the server, to perform the data retrieving task much faster. The service is the same, the user just modify the port on the configuration file of the service, so that's why it's not logical to create a new version of the installer each time.
Any clue or suggestion would be appreciated, thanks in advance.
This can be done by using an multiple instances installation. The general approach is:
create a transform for each instance you want available to the user
use a custom EXE bootstrapper which applies a new transform to your MSI package each time a new instance is installed
The transform should change at least the PackageCode, ProductCode and UpgradeCode.
This is not supported by Visual Studio setup projects. So either you do it manually or use a commercial setup authoring tool which supports multiple instances.

Resources