I am trying to access a MySQL database in a Silverlight application. I have tried to reference to System.Data.Services to access the SQLClient class, but it says:
You can't add a reference to
System.Data.Services.dll as it was not
built against the Silverlight runtime.
Silverlight projects will only work
with Silverlight assemblies.
I have also tried to add a reference to MySQL.Data, but received the same error.
I have read online that I will need to use a WebService, but I do not know how to make one.
I am using Visual Studio Ultimate 2010, I am targeting PHP and MySQL servers, not ASP, and would appreciate any help.
Alem, Silverlight is a client-side technology.
It will only work in browsers. You cannot just make direct call to a database from your Silverlight app.
First off, this would be a major security issue you don't want to deal so fortunately you are not even allowed to.
Use webservices, or even better: WCF services.
Try this link: http://chakkaradeep.wordpress.com/2008/05/31/silverlight-and-wcf/
Hope this helps.
you can access sql through php:
http://www.silverlightshow.net/news/PHP-MySQL-and-Silverlight-The-Complete-Tutorial.aspx
Related
I was working on UWP project in visual studio #xamarin forms, how do i connect to sql Database without using any Web API's and dependency services ?
The application is working in offline mode.
First of all, you must decide whether you want to use Microsoft SQL Server or Sqlite.
These are completely different databases and therefore the code will be different as well.
If you want to use MS SQL, you can use this article.
Somehow from your questions I think that Sqlite will serve you better (just my guess).
If you want to use Sqlite, check this one.
This recipe is designed for Xamarin.Forms PCL project and therefore uses dependency service - since the approach is different on iOS, Android and UWP. If you do not plan to port your project to Android or iOS, you can just call the functions directly, without dependcy service interface.
I've been trying to follow tutorials for exposing an OData service
that wraps an SqlServer Entity model in C#.
Setting up the entity model works fine, but, although I've used nuget to install everything concievably relevant, and although it says that it succeeded, when I try
add new item WCF Data Services
I don't get the right thing listed as a possiblility (as seen in e.g. http://msdn.microsoft.com/en-us/data/gg601462.aspx) I do see WCF Service (Ajax enabled), but that isn't the right thing.
Is this some deliberate limitation for C# in MVS Express 2013 for Web? Am I holding it wrong.
[I'm a Java developer, so this foray into Visual Studio and C# is somewhat uncharted ground for me. It seems pretty good. If it worked as described.]
I do not have much knowledge about the interoperability between .net and visual foxpro. Is it possible to access all controls, forms etc using com and modify and add features in .net and vice- versa. How does the interoperability works
Most of the things can be done using foxpro.
I'm currently migrating a large VFP application.
There the VFP Application hosts an .net com assembly.
You can also put .net Controls in a active X and put dem on the VFP Applications.
But there may be issues concering refreshes and display bugs depending on how your application is implemented.
The FoxPro database can be accessed via oledb. But it is not thread safe and hase some issues getting correct data.
All of these topics are to big to explain them in a single post. but Rickstrahl has some very good tutorials on his website.
One example here
Let me know if you have any further questions.
Try looking at these resources.
Chapter 15 from .Net for Visual FoxPro Developers.
This gives you step by step instructions on creating a Com Sever in Visual FoxPro
and how to access it with .Net.
.NET Interop for Visual FoxPro Applications
I am converting a normal CLR library over to a silverlight library.
SqlConnection, SqlCommand, SqlClient aren't recognized. What libraries do I reference? I am working in Silverlight 3.0.
SqlConnection, SqlCommand, SqlClient are from system.data. System.Data is not part of the Silverlight.
For all database related activities, you should either use a webservice/wcf service/ria services/entity data framework for all crud operations.
As far as I can tell, it is not possible to directly access SqlServer from Silverlight. This makes sense since Silverlight is designed to create "web applications", implying that you'll need to use client-server methods to access the data. You could set up a WebMethod or WCF on a web server somewhere and point Silverlight at it to get the data.
References:
http://silverlight.net/learn/tutorials/sqldatagrid-cs/
http://forums.silverlight.net/forums/t/21012.aspx
http://www.codeproject.com/KB/silverlight/CntDbSlght.aspx
I'm trying to use SQLite3 in C#.NET. I've googled around and found some different API's. I also checked SQLite's website for wrappers. I like them, but want to write my own wrapper without using an added dependency. All wrappers I find that don't require an added dependency aren't free.
I'm wondering how one would read from, execute, and write to a sqlite3 database. Is it a socket connection(tcp? udp? etc?)? I've tried searching this answer on google and all I get are library-specific answers. :/ SQLite's website docs aren't much help either.
EDIT: I also found a COM interface while googling, but is that library specific?
Thanks SO! :)
Have you looked at the System.Data.SQLite library? It's a free ADO.NET library to interact with SQLite and requires nothing else in order to run, since it has the engine built into it.
I've been using it for a while now and find it really easy to work with. It even has a plugin for Visual Studio should you decide to use some strongly-typed tables with it or want to use it to add/create tables.
(Answering the "socket connection" question.)
Part of the point of SQLite is that it's an embedded database - there's no server to talk to, you load the library directly into your process and it talks to the file system directly.
If you want to use SQLite in .NET, you should take a look at System.Data.SQLite, which is a ADO.NET provider for SQLite
System.Data.SQLite is comparatively slower than other providers like SqlClient. I have look into its code.
Now I want to call it throw P/Invoke but not like SQLite provider. It call through P/Invoke every time when ever you access column value through DataReader