473,386 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

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 4871
Dormilich
8,658 Expert Mod 8TB
@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 Expert 1GB
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 Expert Mod 4TB
'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 Expert 1GB
My meaning of saying disadvantage is when it comes to DB connection.(Yeah, it is not intend to do that.)
Aug 15 '09 #5
gits
5,390 Expert Mod 4TB
:) ... just wanted to have that pointed out ...

kind regards
Aug 15 '09 #6
Dheeraj Joshi
1,123 Expert 1GB
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 Expert Mod 4TB
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
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
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...
17
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
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
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...
0
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...
1
by: sanghamitra das | last post by:
I want to transfer some xml documents to sql server database using asp.net.
5
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
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.