473,416 Members | 1,574 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,416 software developers and data experts.

How to bulk insert because file 'C:\Inetpub\wwwroot\Webfile1\Data\upload.txt' ....

347 100+
I have a web page written in asp.net that is basically an upload button that does a bulk insert into a sql table.

When a user presses an upload button, a .txt file is uploaded to a directory on the web server, and also inserted into a sql server on my network. I can get the file to upload to the correct destination but when the server tries to bulk insert to the database I get the following error:

Could not bulk insert because file 'C:\Inetpub\wwwroot\Webfile1\Data\upload.txt' could not be opened. Operating system error code 3

I have attempted to use UNC for the path for the file, but as the file is being uploaded in the first place, that doesnt seem like the problem. I also modified the machine.config on the web server to have the asp.net instance log in as the administrator on the web server, the permissions of the Data directory is set to everyone to have admin rights to that folder. On the sql server, bulk administer permissions are enabled and there are no contraints for triggers or keeping identity. Can anyone please help me understand why this isnt working?

Thank you,

Doug
May 14 '10 #1
1 2890
ck9663
2,878 Expert 2GB
The file is on your client side. Search for some free script on how to upload file to an ftp server and subsequently upload it to your SQL Server.

Happy Coding!!!

~~ CK
May 17 '10 #2

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

Similar topics

5
by: me | last post by:
I'm also having problems getting the bulk insert to work. I don't know anything about it except what I've gleened from BOL but I'm not seeming to get anywhere...Hopefully there is some little (or...
7
by: iqbal | last post by:
Hi all, We have an application through which we are bulk inserting rows into a view. The definition of the view is such that it selects columns from a table on a remote server. I have added the...
1
by: gchavez | last post by:
I'm running MSSQL 2K on Win 2k and just upgraded SQL Server from SP3 to SP4 (that's when my problem started). I have a procedure that bulk inserts from a text file that is located on a Netware 4.11...
1
by: Mike | last post by:
I am trying to use the 'Bulk Insert' command to load a data file into a MS-SQL db. The line I am using is: Bulk Insert SVC_Details From "C:\XFILE.TXT" With (FieldTerminator = ',') I have tried...
0
by: m31hu1 | last post by:
Hi all, I'm new to this forum... I'm trying to let sql store data from a text file, but the data won't display... what am i missing here? Your help is greatly appreciated. create table <?php...
1
by: Jennifer | last post by:
I'm trying to do an insert using Bulk Insert with a fixed length file. I'm using a format file. I'm getting the following error message: Cannot perform bulk insert. Invalid collation name for...
2
by: Jackson | last post by:
Hi GUYS My name is Jackson. I have been strugling to get the BULK INSERT statement import data from a text file to the database. Have a look at this piece of coding: DECLARE @SQL VARCHAR(1000)...
0
by: ozkhillscovington | last post by:
We have sp's in place that do BULK INSERTS from txt files into the tables. This works fine, however they have asked us to add a field that identifies accounting ctr. The only thing that identifies...
2
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer....
2
by: jthep | last post by:
How can I use bulk insert to insert a text file where the columns in the text file is in different order than the columns in the table? I have a ZIP table with Zip_Code, Zip_City, Zip_State and...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.