![Photo](http://www.gravatar.com/avatar/b7b96b7d646d7e684e687462f30bd3c5?s=100&d=http%3A%2F%2Fforums.netduino.com%2Fpublic%2Fstyle_images%2Fmaster%2Fprofile%2Fdefault_large.png)
Netduino + SQL client (maybe System.Data.SqlClient)??
#1
Posted 07 December 2010 - 08:00 PM
#2
Posted 07 December 2010 - 08:23 PM
#3
Posted 07 December 2010 - 09:03 PM
Also as a site note, what would be involved with adding some .net classes to be usable by the Netduino?
I agree wit Bill, it will be a real challenge to port a shrinked version of, say MySql connector (as I don't assume that you have access to the sources of System.Data.SqlClient, and its dependencies) to NETMF within the memory constraints.
I can suggest another method, alternative to Bill's: from the Netduino+ which is the closest to the physical sensors, concentrate on the physical data capture, and then invoke a business web-service via SOAP (merely an http post), which would take care of the business and data tiers. As you well know, these second/third tiers can be implemented on any suitable platform/language whether ASP.Net, Java, Ruby or else. Use Netduino Plus for what it does very well.
My cent
JP
#4
Posted 07 December 2010 - 09:27 PM
I was wondering if anyone has had success with the Netduino plus and connecting to a SQL server for the purposes of logging data to a server. Normally, I would use the System.Data.SqlClient namespace to do this in a .Net application, but it doesnt look like those classes are available on the Netduino Plus.
Is there any way others have found to directly (or indirectly) communicate with a remote SQL server?
Also as a site note, what would be involved with adding some .net classes to be usable by the Netduino? Is this something that would need to be done by Secret Labs (ie in the Firmware), or could i do something in VS to compile them and load them on the device? I know I might be sounding dumb, but I am not familiar with how all the low level stuff works...
I know your question is SQL server specific but would a SQLite configuration suit your purpose better? I'm not even sure if there's a direct solution for a Netduino/SQLite. It could be favorable because it's SQL without the server, in other words, nice and compact.
#5
Posted 07 December 2010 - 09:49 PM
Today LED's, tomorrow, the world!!! Well, OK, maybe servos.
#6
Posted 07 December 2010 - 10:02 PM
#7
Posted 08 December 2010 - 02:51 PM
#8
Posted 08 December 2010 - 05:23 PM
#9
Posted 09 December 2010 - 01:24 AM
I was wondering if anyone has had success with the Netduino plus and connecting to a SQL server for the purposes of logging data to a server...
Something you should consider is to create a WCF Data Service to expose/wrap your database (SQL Server, Oracle, etc.). Then you can query the database with simple http GETs according to the OData standard. It would allow you to do all the standard Select, Insert, Update, Delete operations. The only thing is, you will have to construct the URLs yourself, which is not so hard. So basically, instead of SQL statements, you'll have to translate to the RESTful OData format. But, if you want to do simple logging, I would probably just create a WCF REST service with a single method to write the log entry with a simple http GET. If you use WCF Data Services, the insert operation would probably need to use the PUT verb or something, which isn't too tough either... I suppose it depends on how much flexibility you want. If you just want to do this one thing to insert logging entries, I would do the WCF REST service. But, if you want to have the flexibility to do all the other database operations in the future, I would go for the WCF Data Service.
-Valkyrie-MT
#10
Posted 09 December 2010 - 02:34 AM
$query="insert into tablename values('.$url1', '".$url2"', '".$url3"');";
I can't help but mention the risk of sql injection attacks -- unless i'm misunderstanding how php works, this appears ripe for that sort of exploit. Not that there's much risk when messing around with a netduino, i think establishing good habits regarding injection attacks early on before bad habits take hold are really important.
Here's some info in regards to php:
http://stackoverflow...njection-in-php
... and my favorite sql injection attack:
![Posted Image](http://www.stopreinventingthewheel.com/srtw/images/goofy/sql_injection_-license_plate.jpg)
#11
Posted 09 December 2010 - 03:52 AM
... and my favorite sql injection attack:
"Little Bobby Tables, we call him"
![:)](http://forums.netduino.com/public/style_emoticons/default/smile.png)
#12
Posted 16 December 2010 - 03:35 AM
- Mark Anderson likes this
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users