ExtJS connection with SQL Server using C#.net - extjs4.1

I have created a form and grid using ExtJS 4.1.1 for insert, update, delete in MVC pattern in Visual Studio 2010. I want to perform these CRUD task with SQL Server (I have created the procedure) but I have no idea that how can I use ExtJS with SQL Server and C#. Even in Sencha web there is tutorial for PHP and MySQL only.
Thus, I am looking to connect ExtJS with SQL. I need step by step tutorial and guide that I can complete my official project.

Ext JS is a server-agnostic UI framework... so while some of the examples you have seen are in PHP with MySQL, it ultimately doesn't affect the JavaScript code. For example, the REST proxy:
http://docs.sencha.com/ext-js/4-1/#!/api/Ext.data.proxy.Rest
This proxy (like all proxies in Ext JS) connects to a remote data service. That service sends/receives XML, JSON, or some other data format.
What the remote data service (written in .NET, PHP, Java, or anything else) does with the data once it's been received has nothing to do with Ext JS.
It sounds to me like you need a tutorial for writing web services in C#.

Related

Use Azure SQL db with a reactjs application using Nodejs

I have a basic reactjs application which has a form that I want on submit, should store the value of input elements(text-boxes, selects and radio buttons), to store the data to the database in azure SQL DB. The react app (front-end only yet) is deployed using the Azure App service.
I have been looking for ways on how to approach this, but the more i explored the more i got confused. The official documentation suggests using tedious, and some sources recommend using express with sequelize, and a few more.
I'm looking for a direction on how to approach this. I, being a beginner in this, am open to suggestions or if someone can direct me to a source that might be of some help.
It sounds like you want to directly connect Azure SQL Database from the front-end of your ReactJS App in a browser. There is a similar SO thread How to connect to SQL Server database from JavaScript in the browser? had been answered for this scenario. But it's impossible for working in modern browsers, because the solution using ActiveXObject only works in the old IE browser.
So a backend server using express for NodeJS or other framework in other language is necessary to get the data submitted from the frontend page of ReactJS page and store to Azure SQL Database using tedious for NodeJS or other ORM framework for other language.
For Node.js, please refer to the offical tutorial Node.js Driver for SQL Server to know how to operate SQL Server at the Node backend.

How can I built a standalone windows desktop application ,where I don't need to install any server additionally on client's machine?

I am developing desktop app using wpf mvvm,however I am confused as to how should I proceed with developing standalone application using sqlite,sql server compact etc
If you need a database (really need a database), I suggest using Entity Framework using the code first approach. This can create a local database for the application w/o the need of a database server.
However, strongly consider if you could just use files in the file system. It is amazing how much you can load into memory and if you want this to run on client machine, you likely don't have so much data that you can't just load the data into memory.
SQL Server Compact requires a separate installation step with administrative credentials.
SQLite is a library that can be compiled directly into the application.
In the case of .NET, it is a part of the System.Data.SQLite package, so it is automatically available when your application is shipped with this package (see SQLite deployment for .net application).

How to save data from visual studio apache cordova project to sql server throght web api?

I m new to apache cordova project in visual studio, i have doubt that how system can save data in my sql server from this project. I have already created web API to save data to sql server. How can I call that from apache cordova visual studio project.
Any reference links will be help full.
I made a cordova plugin to access directly to an external SQL Server. Here is the link https://github.com/SergioDosSantos/cordova-plugin-sqlserver.
Android and iOS are supported.
there are 2 options:
in the index.html that is created by the cordova project, use 'ajax Post call' webapi or webservices with Cors enabled and json datatype.
create a signalr Server winform or console or service, call this signalr Server in the index.html using JavaScript with Cors enabled. then inside your signalr Server, call any dll or webapi or webservices, whatever you want.
I would suggest option 2, since the signalr Server can also initiate a call to the index.html's JavaScript functions, so it's two way!

Windows CE - Database

I need to setup an application to scan a barcode from a packing slip and the associated fulfillment items on a windows CE 5.0 device and update the inventory on the server. I'm using VB.NET. However, what is the best way to interact with the database? Integration Services, ADO.NET, RDA... etc... it's a bit overwhelming trying to figure out what I should use to interact with the database. It's currently an Access database, but I imagine I'm probably going to need to migrate it to SQL Server or SQL Server Express.
I'd also need to print the packing slip to a network printer from the device. Is there any way to do this?
Sql CE is an excellent choice if your devices have to function for stretches in a disconnected state (i.e. not connected to the server). If you do use Sql CE, however, I strongly recommend not using RDA to persist local changes back to the server database (see this answer). In any event, RDA merge replication would require your server database to be Sql Server.
If your devices are always connected to the server through a wireless network, then you do not need a local database on the devices at all. Your devices can upload and download data through ASP.Net web services running on the server. Using DataSets for this communication is a good choice, since they are essentially database-agnostic (and thus your PDA code won't particularly care what database you're using on the server).
The web service approach will also let you handle the printing requirement. The PDA would send the relevant information to a web service method, which would then handle printing to the network printer.
My recommendation is to use SQL Server Compact edition (http://www.microsoft.com/Sqlserver/2008/en/us/compact.aspx) for storage engine, and ADO.net implementation of SqlCe in System.Data.SqlServerCe namespace (http://msdn.microsoft.com/en-us/library/system.data.sqlserverce.aspx) for code interaction. They are very well integrated with Visual Studio 2008, including designer support of strong-type dataset and run-time examination of data content on device etc.
No idea about the printing.
In all today scenarios, I would recommend using SQLite. It is the most used database today. Don't bind yourself to an database ecosystem. Just go here and search for "Precompiled Binaries for Windows CE (.NET Compact Framework)". Then you have a SQLite.Interop.*.dll and the System.Data.SQLite.dll. The SQLite.Interop.*.dll has to be placed and deployed besides your EXE file. The System.Data.SQLite.dll is the managed wrapper, that you have to reference in your project. Example: Create SQLite Database and table
SQL Server Compact is not compatible to most mobile platforms like iOS, Android and so on. Microsofts support for old target platforms is poor, leaving Windows CE with only SQL Server Compact 3.5 SP2 where you don't have some essential SQL functions like "LIMIT". Databases generated on the Desktop OS (> Windows XP) will also need to be converted on the device (long delay, when you first open the database), because MS is using different code pages on desktop and Windows CE.
This is Microsofts statement about RDA:
Because of design limitations, remote data access (RDA) will be removed in a future release. If you are currently using RDA, you should consider transitioning to Microsoft Synchronization Services for ADO.NET. If you were planning to use RDA in a new application, you should instead consider merge replication or Sync Services. Note that Sync Services is currently available only for the Windows Desktop Operating System.
Best way to interact with the database is just build the database on the server, compress it als deflate (available under both Desktop and Compact via System.IO.Compression) and send it to the device in whole. Plain and stupid. Most devices have poor import performance, so doing the import locally may take too much time, even if you have a fancy sync framework.
To transfer the database you can use a WCF service or just any web server using a HTTPS GET. Like so:
// ppp_peer is in most cases the active sync connected pc
string url = #"https://ppp_peer/export/database.db.gz";
string html = string.Empty;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (Stream stream = response.GetResponseStream())
using (FileStream fs = new FileStream(stream))
{
// Decompress your database here
}
To ORM your POCO objects just use something like https://bitbucket.org/twincoders/sqlite-net-extensions
However, if you have WLAN access everywhere, I would consider writing a browser application and using the mobile browser together with a web server for your needs. Just keep in mind, that Windows CE 5 based devices don't come with HTML 5 support out of the box. If you have a choice consider switching to a Android based device.

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