473,749 Members | 2,464 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to save file (.xml) to Sql Server database using Javascript?

40 New Member
Is there any way to create xml file and save it in SQL Server database all using javascript? I have no security issues for the purpose i need to do it. Though if anyone could give me some better idea with some sample code, that will be appreciated....

I am generating xml stuff to be saved to database using javascript, but now I am wondering how to save it. Or should i use webservice for this?
Actually I want to achieve above mentioned task in very a efficient and light weighted application manner.......
Aug 14 '09 #1
7 4891
Dormilich
8,658 Recognized Expert Moderator Expert
@saadkhan
though you can create an XML file it’s not possible to save it to DB with Javascript alone (simple reason is, because JS runs only on the client and the DB is on the server)
Aug 14 '09 #2
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
You cannot store the XML file (for that matter anything ) into database through java script.

This is the main disadvantage of JS.(Because it is only for client side and client side do not directly interacts with data base engine.)
Aug 15 '09 #3
gits
5,390 Recognized Expert Moderator Expert
'disadvantage' is a bit too harsh ... JavaScript doesn't have the purpose to interact with a database directly ... mainly: because it couldn't really be done in a secure way ... since all code is downloaded, interpreted and executed at the client and therefor JavaScript is per se 'open source' for everyone. how should it connect, how should it manage connections at all? it lacks the most things that it would need to have for DB-interaction since it was never made for it ... but you could do requests (async/sync) to a serverside script (php, asp, jsp, whatever) that will interact with the DB ... and has all the necessary abilities ... so it is no 'disadvantage' since you need to use a combination, or better a 'stack' of technologies when using JavaScript in a modern way today ...

kind regards
Aug 15 '09 #4
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
My meaning of saying disadvantage is when it comes to DB connection.(Yea h, it is not intend to do that.)
Aug 15 '09 #5
gits
5,390 Recognized Expert Moderator Expert
:) ... just wanted to have that pointed out ...

kind regards
Aug 15 '09 #6
Dheeraj Joshi
1,123 Recognized Expert Top Contributor
OH yeah...

Its always good you point out and make others think what they have told is really correct or not.

Regards
Dheeraj Joshi
Aug 15 '09 #7
gits
5,390 Recognized Expert Moderator Expert
that is not the point ... as writing code relies on very strict correctness ... the usage of plain words should be too ... and telling that JavaScript has a main disadvantage with DB-connectivity or -interaction or whatever is not true ... since it basicly has NO abilities to do that and is not intended for that purpose ... so even to say that the main disadvantage of a car is that it is not able to drive would be correct ... since it is the driver that drives the car ... or the main disadvantage of sugar is that it cannot give your meal a salty taste ...

kind regards
Aug 15 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2369
by: Universal | last post by:
store Images (or any Binary Data) to a SQL Server database using VC++ Can anybody help me in this Thanks in advance
9
3024
by: Ivan Demkovitch | last post by:
Hi! I would like to know if I can save File on Server using server-side code? For example, I like to create thumbnail images and populate specific directory. Do I need specific permissions to do this? (I use public host) Thanks!
17
121874
by: kartheek | last post by:
hi friends, can any one out here help me by giving me the code to connect to an MSACCESS database using javascript.
5
8298
by: lintolawrance | last post by:
hi friends, can any one out here help me by giving me the code to connect to an SOL database using javascript.
0
1335
by: adhimoolamd | last post by:
Dear Friend’s, I need your help’s here to print the pdf file at server side using network printers. Here I am using System.Diagnostic.process namespace to print the pdf file. The problem is system not throwing any error. Executing fine, but no output in printer. But the same code is working and printing pdf files in ASP.NET Development Server and windows application. It’s not working for IIS 6.0.
0
2204
by: tarkuser | last post by:
Hai... I have problem in storing values from flash to database and to select data from a database using Javascript. First i get details of a student through flash and then sotre it to database by an jsp or asp page and same to get back the data. I have the database connectivity problem and also some errors with Javascript. Could any one help me out in this......? Thanks in Advance
1
2000
by: sanghamitra das | last post by:
I want to transfer some xml documents to sql server database using asp.net.
5
7349
by: sumanta123 | last post by:
Dear Sir, How to export/import the excel file in oracle database using sql promt. Please guide me the command(export/import) for the neddful. Thanks in Adavance. Regards Sumanta Panda
2
1749
by: mike klausmeyer | last post by:
I have searched for help with code to generate xml from sql server database using php and can't find a solution. Has anyone done this that can help me? Thank you in advance.
0
8996
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9566
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9333
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8256
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6078
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3319
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.