How to store Arduino sensor value to SQL Database - sql

I am using Arduino UNO. I want to store arduino sensor value to SQL Database, from that Database i want to show that values which was stored in Database Table to user thorough ASP.NET Web Browser. Also I am using ethernet shield.
I have found this method done by PHP, but I want to do this in C#. How can I do that?

Depends on what you want to do...
If you want to run a C# application on Arduino, and your Arduino has an ARM Cortex processor, then you stand a chance. If it has an Intel Quark (x86-32) or an Atmel AVR (8-bit), then you're out of luck.
So in case you have an ARM-processor, you need to download Visual Studio 2017 (Community edition - free). Then you need to install .NET Core 2.0 preview. From there, you can compile a standalone Linux-binary targetting ARM. The result should run, if your Arduino can sport a Linux distro. However, I doubt you will find a version of linux that fits in 32K - but if you do, you could probably compile it and upload it to the Arduino.
If what you mean is "How can you get the sensor data from Arduino", then you can either use System.IO.Ports, or you can use the C# Arduino USB drivere here:
https://github.com/christophediericx/ArduinoDriver
Next, you need a relational or NoSQL database to store sensor information.
Since you're probably a just-starting windows-user, I'd recommend you download sql-server express, and SQL-server management studio Express. If you're not a fan of Microsoft, you can also use PostgreSQL, or SQLite, if you don't want to install anything. Firebird would also be a nice embedded database. If you'd have an extreme high write-frequency, and need multiple computers to store the results, you should use Cassandra (NoSQL) - However, Cassandra is not for beginners, and neither is PostgreSQL, SQLite or Firebird. So I recommend you use SQL-Server Management Studio and SQL-Server Express.
If you also install SQL-Server-data-services, you could also use ReportingService to output your measurements, which has the added benefit of easy filtering, and multiple output formats (HTML, Excel, PDF, PowerPoint, Word, TIFF, Graphs, XML, CSV), without much work on your own. Then you don't need any ASP.NET application.
If however, you want to output the data in your own database table, you need the SQL-Server ADO.NET driver (System.Data.SqlClient) to access the SQL-Server express database. For PostgreSQL, you'd need the PostgreSQL-ADO.NET driver (Npgsql), and for SQLite you'd need System.Data.SQLite.
You can output the table in ASP.NET web forms with DataGridView, and do DataBind in the Page_Load event. Or you could use the more modern ASP.NET Core framework, to write a REST-service, and display the table with JavaScript and AJAX/JSON (use a JavaScript-grid like HandsonTable or SlickGrid). You'd need to serialize the data to JSON using Newtonsoft.JSON.
Or you could display the table in real-time with web-sockets and a web-sockets real-time DataGrid.

Related

How to connect to a database with 64 bit labview

So I am using labview and their data connectivity tool kit only works with their 32 bit version. I need to use their 64 bit version though to be compatible with some of my other files.
If I have a local sql database, which I access using the mysql command line client, what would be the best way to talk to it? Should I use executables like bat files or is there a better method? Should I store data in a different way?
Thanks in advance for your help.
I have never really liked the data connectivity toolkit, mainly because it is Windows only. That being said, I recommend setting up a MySQL server on your computer and using TCP/IP to communicate with it. This community forum link is a good start, although there are some issues with this code. I use code based off of that in my software, unfortunately I cannot post that source code.

Migrating a Compact Framework 2.0 App to Windows Phone

I have a Compact Framework 2.0 application written years ago in VB.NET using VS2005. The application uses a local SQL compact database (.sdf) file. The application has been running on HP iPAQs for years.
I want to look at making this available to Windows Phone users. Any suggestions for the easiest way to do this? When I say easy I mean quick I suppose, the client is not interested in paying for it, so if there was a crude way to implement/achieve it I would be prepared to go that route.
The alternative is building a new Windows Phone app, my first. Which would be fun, but not very good for the balance sheet! Thanks all.
Probably the only option available is going to be a wholesale rewrite of the application. If you were strategic in your original design and kept the business logic and UI separate, then that code will transfer pretty easily, but the data access code will have to be rewritten and all of the UI code will have to be rewritten.

Getting started with arcobjects, without aiming to be developer?

What is the best route or place to get started with arcobjects if one is not a developer and not aiming to become one?
I've been using gis professionally for a long time, almost two decades, arcinfo/arcgis for most of that; I'm pretty good. I'm learning software development, and even have a modestly successful small python application used in a public project; I'm not good! I don't want to become a full fledged software developer but I keep running into things I just can't do without programming (example). In the arcgis world this puts me pretty squarely in the python camp, which is fine by me since I like python, however python does not have straightforward access to arcobjects.
Soooo, I need to get started, but where? Arcgis help says to get started with the ESRI Developer Network but $1500/yr is definitely not in my budget, and sounds like using a sledge hammer to swat mosquito. And which language .NET, Visual Basic, or Visual C++?
Thanks for your thoughts.
Assuming you have desktop, I'd just install the SDK from the desktop installation DVD's and download the free VS2010 60 day eval (which can be extended).
VS Express is supported, but I've never used it.
For language, I'd stay away from C++. There's more sample code available for C# than VB.NET. Except for the yield keyword, VB.NET and C# are equal.

Is there any FREE ORM for .NET Compact Framework (Windows Mobile 6.1, SQLServerCE)?

Looks like I found a good commercial variant, but I'm looking exactly for Free one. Does someone know some?
How about the OpenNETCF ORM? It's free, lightweight, and was built specifically for the Compact Framework, then ported to other platforms (as opposed to someone shoehorning a desktop ORM into the CF).
I am currently looking for a free .net ORM for use on Windows CE. So far I have found these commerical options:
DevXpress XPO
LLBLGenPro
EntitySpaces
NHibernate sadly is not an option because it uses features that are not available in the Compact Framework (e.g. reflection related functionality).
If using a SQL database as your underlying data store is not absolutely necessary then Karvonite is worth consideration. It is a free (Ms-PL) object persistence framework compatable with the .net Compact Framework. Do you need to use SQL Server Compact or are you really just wanting an easy way to persist your domain?
I will update you if I find more options.
I built DapperLite to work on .NET Compact Framework and full .NET. It's basically a Dapper clone, so it's a single file under 200 lines you can drop into your project.
I had tried OpenNETCF.ORM but found it too opinionated. I love using Dapper in my desktop apps but unfortunately it doesn't work with .NET Compact Framework.
I also built a Micro-ORM layer over the top of DapperLite to make it a bit easier to use, which is essentially a clone of Dapper.Rainbow

Media on Windows CE using Compact Framework

I have the following requirements:
I need a api that works on CE (x86) + .NET Compact Framework to play videos (Similar to CorePlayer API... Just free)?
Is their anything else available or must I use CorePlayer?
You could use the MediaPlayer with COM interop. Have a look at this and this.
Also, Media Player may not be installed in your device.
You need to use DShow and have the codecs for whatever media you intend to play in the image. COM interop for WMP 9.0 (which is what ships up through at least CE 5.0, maybe also in 6.0) is a non-starter for managed code.
If you don't know DShow, it's a fair amount of work - even in native code - as DShow is not a fun or friendly API set.
The plus side is that you don't need WMP at all in the image, so you can typically use a Core CE license (Pro is required to use WMP). I know of a commercial DShow control, but you said you're looking for a free solution and I'm not aware of anything other than rolling your own. Depending on your level of familiarity with COM interop (which you'll need for the DShow stuff) and the use of DShow and filtergraphs, I'd allocate at least a week or two to getting this working.
One added note - the complexity also changes depending on how you want the video displayed. If it's just full-screen then it's a bit less work than getting it inside a Window within your app. Not a lot less, but at least a little.
DirectShow?
Check out this page for a starting point.
Provided that DirectShow is present on your CE, which I don't know...
EDIT: Since you can use DirectShow, I'd like to add a bit.
As ctacke notes, it can be a lot of work if you do everything manually, but it's pretty straightforward if you can use IGraphBuilder (see the sample I linked above).
I don't know much about DirectShow versions, but the one included with Windows Mobile 6.0 lacks a splitter for MPEG audio. It means, e.g., that out of the box it won't play .mp3 files unless you wrap them in RIFF headers.
I bet you can convert some of DirectShow.Net to run on CE if you are looking for a C# solution.