w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Is it possible to pull data from HTML5's local storage and save to server database?
Yes it's possible, why wouldn't it be? When you pull data from the local storage, the data works just like any other Javascript variable, there are no restrictions that would stop you sending it to a server other than the lack of Internet connection. how would you go about implementing it? First you'd need to detect the connection status, see this question. So when a user tries to update their status, it checks if the connection is online and if it isn't then save it to local storage. Use the methods in the linked question to detect when the connection comes back up, and at that point pull the data from local storage and send it to the server via ajax, then clear the local storage to prevent duplicate data being sent.

Categories : PHP

Is it possible to secure local database data when selling an offline (local installation) web app?
You cannot stop that user from stealing the data but it should be possible to encrypt the local data with JS in case the laptop is stolen etc. To do this you would need to prompt the user for the encryption key or use some other method... It should obviously not be stored in the local database itself

Categories : Database

how to connect MS Access database with matlab (transfer data from GUI and save in database )
You need to run SQL queries on the database; you can do this with database.fetch (and a few other friends). The example query from the docs: conn = database('dbtoolboxdemo','',''); setdbprefs('DataReturnFormat','cellarray') results = fetch(conn, 'select productdescription from producttable') % Not in the example in the docs: this syntax, which I prefer, is also supported results = conn.fetch('select productdescription from producttable'); Note that you will also need to know how to write SQL. For that, there are plenty of resources online - you just have to search for them.

Categories : Database

How to save data from a form with HTML5 Local Storage?
LocalStorage has a setItem method. You can use it like this: var inputEmail= document.getElementById("email"); localStorage.setItem("email", inputEmail.value); When you want to get the value, you can do the following: var storedValue = localStorage.getItem("email"); It is also possible to store the values on button click, like so: <button onclick="store()" type="button">StoreEmail</button> <script type="text/javascript"> function store(){ var inputEmail= document.getElementById("email"); localStorage.setItem("email", inputEmail.value); } </script>

Categories : HTML

How to handle C++ internal data structure in R in order to allow save/load?
Finally, I came to 2 solutions to handle correctly the R save/load mechanism with C++ objects (data persistence). None is perfect, but it seems better than doing nothing. Shortly, those solutions are (details are available below): Using R Raw data type to store the C++ objects. This has the advantage of being memory efficient, but it is quite complex in practice. Personally, I won’t use it for a big project, because memory management can be tedious. For sure, there are some possible improvement maybe by using template classes (please share it, if you have an idea). Store the object as R and C++ structure and rebuild the C++ objects after reload. The C++ object are built only once (not for each function call), but the data is stored twice. This has the serious advantage of being much e

Categories : C++

how can communicate two SQL database in LAN to save data in both database
Which database engine are you using? There're several ways to build a distributed/replicated database, I'm sure you'll find out how to do it by reading your engine documentation, but we cannot help here without more info.

Categories : SQL

Java Script get data from server (asp.net) and save it in local storage (client side)
You are trying to throw in an object into localStorage Change localStorage.setObject("teamworkGantDemo", prj); to localStorage.setItem("teamworkGantDemo", JSON.stringify(prj)); or simply localStorage["teamworkGantDemo"] = JSON.stringify(prj) But if you are insistent on using a wrapper around this, you could do this : Storage.prototype.setObject = function(key, value) { this.setItem(key, JSON.stringify(value)); } Storage.prototype.getObject = function(key) { return JSON.parse(this.getItem(key)); } Then use it this way : localStorage.setObject("teamworkGantDemo", prj);

Categories : Javascript

Copy data from local production SQL Server database to remote read only SQL Server database
I think the logshipping solution fits your needs. After a one-time setup proces, the logs would be continually shipped from the local db to the remote db. Keeping the remote perfectly in sync with the local one, providing you with the readonly copy. Logshipping is available in all editions, besides Express. There would be no need for a continuous restore process. You can find more information here.

Categories : Sql Server

How can I save my form data into the database
The form is in the $form variable. When you first run the controller, you're probably in the GET mode and you construct the $form with a new Familia. On the second call, after doing a POST in the twig, you'll bind the request data (the $petition) to the $form, which is then validated and if everything is ok, you persist the $familia using doctrine entity manager. What you have is the typical controller that is explained quite well in the symfony books: http://symfony.com/doc/current/book/forms.html Carefully read the symfony book http://symfony.com/doc/current/book/index.html I know that is quite a literature to read, but it pays well since is extremely well described.

Categories : PHP

Save jpg data from database to a jpg file
You can use MemoryStream object in C# as below MemoryStream memstmSignature = new MemoryStream(InkToBytes(ds.Tables[1].Rows[0]["SIGNATURE"].ToString(), "image/gif", 0, 0)); Image imaSig = Image.FromStream(memstmSignature); imaSig.RotateFlip(RotateFlipType.Rotate180FlipX); imaSig.Save(Path.Combine(this.temporaryFilePath, this.signatureFileName)); memstmSignature.Close(); Helper functions below private static byte[] InkToBytes(string inkStrokes, string encoderType, float x, float y) { ArrayList strokes = new ArrayList(); // max size for bit map int maxX = 0; int maxY = 0; // intialize the strokes array with text string int strokesCount; if (inkStrokes.Length > 0) { if (inkStrokes.EndsWith(

Categories : Sql Server

Save data instead of adding to database
I'm afraid you'll need to get article again from database, update it and save changes. Entity framework automatically tracks changes to entites so in your repository should be: public void EditArticle(Item article) { var dbArticle = entities.items.FirstOrDefault(x => x.Id == article.Id); dbArticle.item_title = article.item_title; //and so on //this is what you call at the end entities.SaveChanges(); }

Categories : Asp Net

Copy Data From ODBC Connection To Local Database
You can write a stored procedure that runs your query and just modify it slightly to output to a physical table. For example: select a.FirstName, a.LastName, b.City, b.State, b.zip into _temp_report from customers a join addresses b on a.customer_id = b.customer_id In the example above, the into _temp_report part is the important part. It will create a new physical table with the results of your query. Then you can simply point the reports to that table. You can use SQL Server Agent to create a job that runs the stored procedure on a schedule. You'll obviously need to add some logic to remove the _temp_report table on each run of the stored procedure so you don't try to re-create it each time the job runs.

Categories : Sql Server

Data from a JSON API combined with local database in Rails
@userlist = [] that line, each time through the loop @data.each do |key| is clearing out the previous data by re-initializing @userlist. Then you're returning the user you added last, since all the others were thrown away the last time you assigned an empty array to @userlist. Just move @userlist = [] above @data.each do |key| and you should be good.

Categories : Ruby On Rails

How to get all the data from form at once and save in database in Django?
Let's imagine you've a Django model form class (you cannot save in DB directly a simple form since there is no corresponding schema, but you can with a model form) class MyForm(forms.ModelForm): field1 = forms.IntegerField(...) ... You rendered it in a template with {{ form.as_p }} Then in the reception view, do the following: def myview(request): if request.method == "POST": form = MyForm(request.POST) if form.is_valid(): form.save() # here you save the form all at once else: ... # here return the "form" to the template, and render it with form.as_p: it will display the validation errors else: ... # here treat the get request. If not get: return an Http 404 response

Categories : Django

Read Email and save data to database in PHP
If the problem really is only parsing, in this case I would recommend simple regex. However what I do recommend is using named patterns, so you dont confuse the indexes and maby have wrong matches. Here is a quick example: $str = <<<body Name: xyz Zip: 33402 body; if(preg_match('/(?P<name>w+): (?P<zip>d+)/', $str, $matches)) { print_r($matches); // db beeing your database connector, for example pdo $sql = "INSERT INTO mytable (name,zip) VALUES(".$db->quote($matches['name']).",".$db->quote($matches['zip']); echo $sql; } else { //mail does not correspond to pattern! } If your mail gets longer, use preg_match several times. Possibly for each field you want to parse separately. Because writing a huge regex if you have more fields is very

Categories : PHP

Save data in database automatically at particular time
Use a ScheduledExecutorService. Calculate the delay until the save date (using Calendar) and .schedule() your Runnable, which will save the data. You will probably want to use a Executors.newSingleThreadScheduledExecutor(). Side note: please use a prepared statement and not string concatenation to generate your SQL query! The JDK has all it takes to do so, there is no reason not to use it.

Categories : Java

How to save data in database through dynamic controls
If you are creating dynamic controls, you need to make sure you recreate them on a post back. This needs to be done before viewstate and events are wired up. The best place to create the controls is during the Page_Init function, no the Page_Load. Look into ASP.Net Page Life Cycle to see how a page gets build.

Categories : Asp Net

How to save edited JTable data to database?
As you are using DefaultTableModel you have to register a listener to that model a TableModelListener listening for changes. How to use TableModelListener Example: myTable.getModel().addTableModelListener(new TableModelListener(){ @Override public void tableChanged(TableModelEvent evt){ //code here } });

Categories : Java

How to import data from local text file to mysql database
The "learnsql" user must have FILE privileges. grant file on *.* to user@localhost identified by 'password'; And MySQL must have operating system access to files, of course.

Categories : Mysql

fetch data from a database server to local application continuously
There are numerous ways to accomplish this - which you choose depends on the constraints of your particular situation. The simplest is to just have your local application poll the server at regular intervals. This is crude but has the advantage that it will almost certainly work without modification to your router/firewall settings. Alternatively you could write code on the asp application to send a message to your local application only when a change occurs. This is a true push, but is likely to fail without port forwarding on your router; if you can configure the router, the code should be straightforward enough. Essentially this question is too vague to answer properly here - you will likely get some replies saying 'ok and which bit are you stuck with?', 'what have you tried?' etc

Categories : Asp Net

Is it ok to use JSON in order to store data in a mysql database?
If those are fields you don't need to access directly from the database, nor do you need to filter by them (you need to be very sure about this) then it would be ok. As you said, it will work, but it really depends on the particulars of your project. For instance price may be problematic, since you will probably want to be able to filter by price with ease (not saying you can't, but it will not be as straight forward as with tables). The way I would do it is the following: A table with a list of features that you can expand with ease A table which contains the id of the content (or product) the id of the feature, and the value of the feature. With that little adaptation you can easily list features, filter by features, group by them etc, and still have the ability to define the struc

Categories : PHP

How to fetch only 3 data from database table in cyclic order?
you can set a field in table called taken, in first time the 3 rows taken should be updated with the value 1 in taken field,rest rows will have null in taken. when second time just get the row with max id which has taken=1, increment that id by 1 and get next 3 rows from that id, after getting set the new 3 rows of taken 1 and remove 1 from old 3 rows thats the logic you can apply

Categories : PHP

Retrive Data Fron Txt File And Save It in Database
it's as simple as: $ip = fopen('data.txt', "r"); $line = trim(fgets($ip)); while(!feof($ip)){ // do something with line in $line //.... // reading next line $line = trim(fgets($ip)); }

Categories : PHP

Flask - Save session data in database like using cookies
You should check out Flask-KVSession, which is self-described as a drop-in replacement for Flask‘s signed cookie-based session management. Instead of storing data on the client, only a securely generated ID is stored on the client, while the actual session data resides on the server. Which basically describes traditional server-side sessions. Note that it supports multiple database backends: Flask-KVSession uses the simplekv package for storing session data on a variety of backends. See the Example Use for an example of what to import and how to configure it.

Categories : Database

How to save the data to database through dynamically loaded controls
in the database vision you need a table with at least 3 columns, first a VARBINARY column that is called BLOB column to store your file, second a VARCHAR column to store your file extension (e.g .gif, .jpeg) , third a VARCHAR or NVARCHAR column to store your caption. but the point is in your application you need to convert your file into array of bytes then pass it to sql server as varbinary parameter. private Byte[] getDocumentFormatter(string path) { FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read); BinaryReader br = new BinaryReader(fs); Byte[] bytes = br.ReadBytes((Int32)fs.Length); br.Close(); fs.Close(); return bytes; } but in web environment you can replace path with your

Categories : C#

save dynamically created controls data in database asp.net mvc
Try this: [HttpPost] public ActionResult Create(List<StudentAdditionalDetail> additionalFields) { ads.AddAdditionalDetails(additionalFields);//calls the insert method return RedirectToAction("Index"); }

Categories : C#

Save view state data into database Error
When you are saving into the database, you redirect right after each insert. Hence, none of the subsequent inserts are executed. I would move the redirect out of the loop. Maybe you can pass the number of records inserted in the query string as well. protected void Button2_Click(object sender, EventArgs e) { foreach (GridViewRow oItem in GridView1.Rows) { string str1 = oItem.Cells[0].Text; string str2 = oItem.Cells[1].Text; string str3 = oItem.Cells[2].Text; insertData(str1, str2, str3); } Response.Redirect("WebForm1.aspx?stat=insert"); } public void insertData(string str1,string str2,string str3) { SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["CIMProRPT01ConnectionString"].Conn

Categories : Asp Net

save data to database with click of button/link
If I understood correctly, you need to add button onClick event handler? If so, here you go (using jquery 1.9+): $(document).ready(function() { //onClick event handler for button with id "btn_save" $(document).on("click","#btn_save",function() { //Your code here }); });

Categories : PHP

saving data in cookies to save trips to database
Definitely an interesting approach. With this cookies plugin, if you don't specify the expire, your cookie will only stay for the length of the session. So you can simply do: $.cookie("basket-data", JSON.stringify($("#ArticlesHolder").data())); And it will stay for this session only. Just for the record - session storage is definitely a better choice than cookies.

Categories : Jquery

How to save and retrieve data from sdcard or database in android?
Have a look at SharedPreferences or if you plan to store more data try a SQLite database. Here is the tutorial to store files in Android.

Categories : Android

Xml data Node values need to save into Database table
You can easily extract the information from the <Computer> node and insert it into Asset: (PS: Note: it's a processor - not a "processior" (no i after the two s) ) DECLARE @Input XML SET @Input = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Computer Name="WH7" Processor="Intel(R) Core(TM)2 Duo CPU P9600 @ 2.66GHz" Manufacturer="Dell Inc." Model="Latitude E6500" Domain="WORKGROUP" RAM="3536 MB" ServiceTag="DGQKTJ1"> <BIOS Manufacturer="Dell Inc." Version="Phoenix ROM BIOS PLUS Version 1.10 A19"/> </Computer>' INSERT INTO dbo.Asset(Name, Processor, Manufacturer, Model, Domain, RAM, ServiceTag) SELECT Name = @Input.value('(/Computer/@Name)[1]', 'varchar(50)'), Processor = @Input.value('(/Computer/@Proc

Categories : Xml

How to Edit & Save ViewModels data back to database
First of all, it's really good that you are using ViewModels but for this particular case, it's probably not necessary, your Create view could look like this: @model MvcApplication1.Models.Doctor //other fields here <div class="editor-label"> @Html.LabelFor(model => model.DoctorAddress.Address) </div> <div class="editor-field"> @Html.EditorFor(model => model.DoctorAddress.Address) @Html.ValidationMessageFor(model => model.DoctorAddress.Address) </div> <div class="editor-label"> @Html.LabelFor(model => model.DoctorCharge.IPDCharge) </div> <div class="editor-field"> @Html.EditorFor(model => model.DoctorCharge.IPDCharge) @Html.ValidationMessageFor(model => mo

Categories : Asp Net Mvc

How to efficiently save data to a remote server database (python)
Django databases can be remote - there is no requirement they be on the same host at the django server. Just set an appropriate HOST and PORT. See: https://docs.djangoproject.com/en/dev/ref/databases/#id10 Update: Based on your comment, I understand that you want to write python/django code that will run in the browser, and connect to a remote database. There is no practical way of doing this. Have the data sent back to your server, and forward it on from there. Update 2: If you are able to distribute software outside of the browser, you could have a small django deployment on each client computer, which the user connects to through their browser, which could connect directly to the database. Obviously, security considerations apply.

Categories : Python

Python, MySQL, load data from database, change it, save it again?
cur.execute returns the number of rows affected - in your case, just 1 row, which is why it always returns 1. To get the actual value, you need to do cur.fetchone(), which will return a tuple of values - again, in your case, a tuple containing a single int. Just an additional tip, since this is a 'learn Python' exercise: global variables are usually frowned on. You should pass xp explicitly into your gainxp function.

Categories : Python

"Undefined property" when trying to save javascript form data to mysql database via php
I note you are calling echo $_POST['jason']; at the end of your script which I would expect to cause this error - just a typo in the question? You have it correctly as 'json' earlier. Update Ok - think I see it: Defined pcompensation: <textarea name='pcompensation'/></textarea> Reading it: item.find("input[name=pcompensation]").attr("value",p.compensation); Which should be: item.find("textarea[name=pcompensation]").attr("value",p.compensation); Same for your other textarea custom fields.

Categories : PHP

Save Canvas Image data to mySQL database and retrieve it to edit again
Now only i saw this post i got success for storing and retrieving the canvas images using the following references. You need to convert the canvas to image format and the save i to databse. Create The canvas Store the canvas image into mysql DB

Categories : HTML

permission and timeout issues connecting to local northwind database in C# entity data model
Found a suggestion here by Peja Tao. Maybe that will help. http://social.msdn.microsoft.com/Forums/sqlserver/en-US/8cdc71eb-6929-4ae8-a5a8-c1f461bd61b4/provider-sql-network-interfaces-error-26-error-locating-serverinstance-specified

Categories : C#

How to save Image(imported from gallery of phone to android app) and save into android app local directory?
Using for example: File path = getExternalFilesDir(Environment.DIRECTORY_DCIM); File image = new File(path,imageFileName ); Your image will be save in your app directory.

Categories : Android

Oracle Forms 10g - why do I have to click save so that my insert query will save to database
Oracle Forms provides a great deal of functionality for you so that you don't have to write it. For example, if you base a block on a table, and if the user enters data and clicks "Save", Oracle Forms knows whether to execute Insert, Update or Delete statements appropriately followed by a Commit. In your case, you have ignored that functionality and have hardcoded an Insert and Commit in your button code. Therefore, the user does not have to click the Save button, because the data has already been "saved" by your Add button.

Categories : Oracle

How to connect to local database through webpage that is not local using php
You can connect to any server with the client, restricted to local/network firewalls and routing tables. The server on the other side has the same restrictions (firewall, network routing) + a few security tweaks: user table might only accept specific hosts bind-address options (in newer versions) limit access for ip/interface 0.0.0.0 = all are allowed in older versions of the mysqld this option is called skip-networking to allow tcp connections by default mysqld listens only locally or through unix socket The server being not exposed to the WAN, you'd either change this or use VPN to connect.

Categories : PHP



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.