Linq to SQL object in Win Phone 8 - wcf

I have a Class Library which contains a Linq to SQL object which is then connected to a database. I also have a WCF Service for other apps.
I now decided to use the same database in a Windows Phone 8 application, so connected to the Web Service which was fine. Some of the methods require a Customer object so i tried to import the DLL library with Linq to Sql and i got an error that it cant be imported (unable to add specified project reference. the reference must be a windows phone project).
I done a search on this and found some threads with similar issues but nothing to state what workarounds if any i could use to connect to a WCF Web service which accepts a Customer object as part of its method.
So is there a workaround? Does the service need to be recreated from scratch? Or any other alternatives.

Related

How to connect to remote database with windowsphone

In my app, I want to read a remote sql database. After spending some hours on searching the net, I found out that this can not be done with sql commands but that it needs a webservice wrapper I.E WCF or ADO.net
Are there (and where) any examples on how to read/write records to a remote database server using windowsphone.
Thanks,
Bart
Your best option will be to use WCF Data Services with an AD.NET Entity Framework model (there even is a client for Windows Phone). Beware that the Windows Phone client by default does not use compression and does not use the compact json format. UPDATE: Latest client/server parts now use json with Windows Phone

Retrieving the COM class factory for component with CLSID {XXXX} failed due to the following error: 80040154

I am running 32 bit Windows 7 Operation System which has IIS 7.5 installed.
In Visual Studio 2010, I open my solution having the web site project hosting WCF service. I have created an application in the IIS which points to the website project. The web site's bin folder has many assemblies which I need to refer. But those assemblies also have built using .NET 4 on the same computer.
I can browse the WCF service using both HTTP & HTTPS.
However, when i access the service from the test windows application (using the proxy class of the WCF contract), I get the error in question. Everything was working without problem earlier.
Anyone can help to fix the issue?. How to investigate this issue?
Error 0x80040154 means "Class Not Registered", which usually means you're depending on a COM component that hasn't been installed properly on the machine.
Is any of those Assemblies you reference a COM Interop Assembly? If so, find out what it uses and then install the appropriate COM component.

How to run a COM .dll on a remote server?

I have a legacy 3rd party COM .dll that is used to provide an Excel-callable interface to a proprietary database product. The .dll runs on the same physical machine as Excel. I have a need to execute the .dll (and the database it is calling) on a remote server while still maintaining simple Excel callability from the client. I'm totally confused by all the different MS technologies that seem to hint there is an easy way to do this. Can someone please point me in the right direction (easier is better)?
There are 3 steps:
Register the COM DLL on the remote server.
Tell COM to go to this server to find the COM DLL.
Configure security.
In order for a COM server that is a DLL to run in its own process, it needs a COM surrogate (see MSDN).
In Excel, if you use VBA to get at the COM DLL, the CreateObject method has an optional parameter that is the machine where the server is located, which is exactly what you need.
If you do not use VBA, I am afraid that you need to write a proxy server that forwards the calls to the real server. I could not find a way to do this by configuration.
Use component services on the remote server to setup security, so that users from Excel can launch and use the COM server.

Adding a WCF Service (<> WCF Service Reference) gives "Specified Cast is Invalid"

When adding a second WCF service to an existing WCF project, or adding a first WCF service to a project gives me a dialog box "Specified Cast Is Invalid". WCF files are added to the project except interface file. Web.Config isn't updated neither.
I think the problem started after updating VS.NET 2008 to VS.NET 2008 SP1.
You can always reinstall SP1 if you are uncertain about the installation. A successfully install SP1 should not cause this problem.
When we have had problems adding WCF references there have generally been on of the following problems:
Data contracts incorrectly specified, missing a tag [Datamember], [DataContract]...
Is your Interface marked as public?
If you are referencing a DLL with types from both the client and the server, is everything serializable and public. Are you using the same version of the dll on both sides?
Is your contract very large? You may need to increase the buffer sizes to get the information to build the proxy.

Data access in Silverlight 2.0

I'm new to silverlight and I'm porting from asp.net 2.0. I have done many data binding applications in asp.net where I use sql server 2005 and use it's tables and access them via sqlconnection object and perform all kind of database related functions. Can anyone tell does silverlight 2.0 supports such kind of facility. If so can I use any database server, if not is it through web services? can anyone point me some good place to start with.
No you can't connect directly to a database server. You need to use a web service. However to simplify things you can call a data web service such as SQL Server Data Services or Amazon S3. Otherwise use REST.
Silverlight is a client side technology. You can't access a database on the server directly. You have to use a layer in between, like webservices. For a nice tutorial on how to do that, check http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx