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

fileupload in mysql mono

3
im trying to upload file in to mysql database using the following code.. but it shows jus the file name and not the entire file while i retrive. how to store the file and retrive it from mysql using mono c#. ?

Expand|Select|Wrap|Line Numbers
  1. cmd.CommandText="insert into fileup values('"+entry1.Text+"','"+filechooserbutton1.Filename+  "')";
  2.  
Feb 17 '12 #1
2 2153
PsychoCoder
465 Expert Mod 256MB
It's really inefficient to store the actual file in your database, for something like this I would store just the file name and the path to the file.
Feb 17 '12 #2
It is not advisable to load the whole image in the database. It's recommended to upload the file to the sever then save its path in the database. And in order to retrieve the image all you do is retrieve its path for the database.
Anyway, I know that mysql uses datatype BLOBs (Binary Large OBjects) to save large files. In C# we use an array of bytes. So, I guess you'll retrieve the image into an array of bytes then assign it to the image control.

There more explanation <Link Removed>. Good Luck
Feb 22 '12 #3

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

Similar topics

3
by: dave | last post by:
Hello there, I am at my wit's end ! I have used the following script succesfully to upload an image to my web space. But what I really want to be able to do is to update an existing record in a...
9
by: John Bailo | last post by:
Retrieves a table from a mySql table into a Datagrid. Uses mono asp.net on a Suse Linux system: http://texeme.com/AspNetOnApache/Presidents1.aspx Shows aspx.net source code. -- Texeme...
4
by: The Bear | last post by:
Has anyone successfully used MySQL with C#? I'm having problems using the Update command Here is the code snippet. I am able to connect to the database. However when I try to update the...
5
by: Tim Bücker | last post by:
Hello. I am trying to get a connection to MySQL using OleDb but it seems that I am making something wrong. I´ve found this source in the net but it doesn´t work for me: ...
2
by: ME | last post by:
I am getting: "ERROR SQLBindParameter not used for all parameters" when attempting to run the following code: Private Sub DataGrid1_UpdateCommand(ByVal source As Object, ByVal e As...
3
by: Dave Smithz | last post by:
Hi there, A new potential client currently run there database on using MySQL and PHP, it has about 7000 records and runs rock solid over the web. However they need much more functionality and...
13
by: Jerome Tan | last post by:
hi there, how is vb.net database programming easier compare to php-mysql combination? i'm having trouble understanding how vb.net work compare to php-mysql database accessing. can anyone shed...
0
by: narmathabala | last post by:
Hello, I need to insert BLOB into MySQL DB from a C#.NET 2.0 environment. The piece of code which I am using is listed below. Note: fileup is a FileUpload holder <code> Stream content =...
0
by: Christian Schlemmer | last post by:
If my code will run into the filesize-limit condition, the INSERT-statement will be executed. is there a way to avoid that? Protected Sub DetailsView1_RowInserting(ByVal sender As Object,...
0
by: Kim Charlene | last post by:
Hi, guys! I've created a java servlet where I can upload video with limited size. The video uploaded is being saved in the mySQL database as BLOB. How can I retrieve that BLOB and display it as the...
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
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?
0
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,...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
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...

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.