can i upload my pdf or word file to oracle/SqlServer database table ?
View Complete Post
How can I upload a file to a database (with as little code as possible!) along with a desciption of a file and then search through the descriptions to retrieve the appropriate files. Then how can I click on one and download it.
I am not a very advanced programmer and would like full step by step code if possible not just a link to a website.
Thank you very much
I'll start off with the usual caveats.. new to the forum, new to programming, not a programmer by trade..just a dabbler
A little background..
I run a hockey pool for me and a few friends. I currently use Excel to produce everything. Every week I download a csv file from a stats reseller, update my pool, then run some macros to create web pages and upload those to my site. It works alright but I want to take my pool/site to the next level. So I decided to do a new site using ASP.NET and sql express.
My plan is to download an XML file from the same reseller and update my "Player" table every week with the "new" stats.
I used a Dataset, SqlDataAdapter, and the XML file from the reseller to populate my "Player" table in the beginning. It was pretty slick, pretty easy. My problem is I can't seem to figure out how to update my "Player" table with my new stats.
First I tried using the same Dataset/SqlAdapter but it threw a Primary Key exception, saying I couldn't insert that ID because it was already existing in the table. I can fill my dataset from the "Player" table change things and save it back to the "Player" table..but that's not what I want to do.
In my min
i tired a lot of correction, in the end i end up fully used the completely same code and guide of this link.
that was a well step-by-step guide through.
the error i get was, i found out it didnt save the file into table.from the table under the file columnit show <Binary_data>
if i click on download the fileerror code shown,There is no row at position 0.
Source Error:Line 111: Dim bytes() As Byte = CType(dt.Rows(0)("file1"), Byte())
can anyone teach me? thanks..
I have TBL_PRODUCT table : ProductID, ProductName, CategoryID, Image.
I can insert data to table :
public ActionResult Create(tbl_products products)
I can upload image file too
public ActionResult UpHinh(HttpPostedFileBase fileImg)
var fileName = Path.GetFileName(fileImg.FileName);
fileImg.SaveAs(Server.MapPath("/Content/Images/" + fileName));
Help me. Thanks
I'm using a DetailsView control and have a FileUpload control in a TemplateField for uploading images to a database.
However, I'm not sure how to take the image name e.g. Button.png as a value and enter it into the database.
Thanks for your help.
I'd like to allow users to upload a .pdf file via the file upload control (if that's the best method), save the file to the db and then retrieve it so they can click on a link and open the .pdf they've uploaded.
I've been looking for a tutorial on how to do this but keep running into methods of saving the file directly on the server in a directory, not in SQL server (using Linq and VB by the way)
Can someone please point me in the right direction on how to do this? Thanks!
I've been working on a code that allows users to upload images (jpgs) as an optional field. Alhough the uploading works, I'm struggling when the user doesn't have an image to upload. I can't seem to find the way to NOT insert binary data into my database, I just want an NULL value when there is no image. I get this error message: ...expects parameter @Image, which was not supplied.
Here is the code:
I've got a SQL database with a table named contact with different column such Name, Address, email ...
I would like to generate a XML file based on the table data:
<address> 100 main street </address>
After some research it looks like I can use a dataset from that table to create my xml.
Being a beginner I cannot find the right steps / syntax to do so.
Is there any tutorial showing how to work with dataset and XLM?
Thank you for your helps
I'm developing a website using .NET 3.5 and I'm having problems with the asyncfileupload control.
The problem occurs when you upload a file, and then try upload the same
file again. On the second upload, none of the clientside nor serverside
methods fire. Everything works fine if you upload one file, upload a
file with a different name and then upload the first one again.
This is a bit if a pain because on the page i allow the user to delete
the uploaded images so i need the functionality to upload a file with
the same name as the previous upload.
Has anyone else encountered this and are there any work arounds?
I have one xls file which has 1.98 lacs rows. Whenever I try to import it in sql database table then I am getting following error to open OLE db connection.External table is not in the expected format. My code:
string con = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + Server.MapPath("TowerWorkOrders20110316.xls") + ";Extended Properties=\"Excel 12.0\"";
//string con = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Server.MapPath("TowerWorkOrders20110317.xls") + ";Extended Properties=Excel 8.0";
OleDbConnection connection = new
OleDbCommand command = new OleDbCommand("SELECT * FROM [Sheet1$]", connection);
reader = command.ExecuteReader();.................