•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 391,548 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,520 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 3934 | Replies: 1
![]() |
Hi ,
you can do that by simply converting any file to an array of bytes - bytes[] (in c#) or bytes() (in vb.net) .
you can add an HTML control ( file )-which browses on file name - and let its name file_upload , right click and selct "run as server control" to use it in the c# or vb.net code.
in C#
int len=file_upload.PostedFile.ContentLength;
byte[] bData=new byte[len];
//fill array of bytes
file_upload.PostedFile.InputStream.Read(bData,0,len);
Note the field type of database (in Sql server) should be image .
You must send the value by a parameter and the value of the parameter will be the array filled .
param1.value=bData ;
then executeNonquery(); will insert the file .
I hope i could help you .
you can do that by simply converting any file to an array of bytes - bytes[] (in c#) or bytes() (in vb.net) .
you can add an HTML control ( file )-which browses on file name - and let its name file_upload , right click and selct "run as server control" to use it in the c# or vb.net code.
in C#
int len=file_upload.PostedFile.ContentLength;
byte[] bData=new byte[len];
//fill array of bytes
file_upload.PostedFile.InputStream.Read(bData,0,len);
Note the field type of database (in Sql server) should be image .
You must send the value by a parameter and the value of the parameter will be the array filled .
param1.value=bData ;
then executeNonquery(); will insert the file .
I hope i could help you .
Life Is A Big Code
Rushdy Ibrahim
Egypt
Rushdy Ibrahim
Egypt
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb ASP.NET Marketplace
•
•
•
•
.net .net framework 3.0 access adsl adsl1 adsl2 adsl2+ ajax apple asp cable code combo connection custom data database developer development digital drm dropdownlist guid partition table hacker internet ipod itunes management microsoft module mp3 music net network news office per reuse rights second security skin sql store survey theme vista web windows workflow 240000
- Upload a word file into mysql database (Java)
- Find word in file!! (C++)
- How to COmpare a word file and an XML file (C#)
- Reading pascal file and searching for a particular word in that file (Pascal and Delphi)
- When Users Upload *.txt file, i will get Total Points ,Points Per Game ,etc... (PHP)
- Variable URLs from SQL Table (ASP.NET)
Other Threads in the ASP.NET Forum
- Previous Thread: How to Incorporate Director?
- Next Thread: Web Service with ASP .Net

anybody help me plzzzzzzzzz 
Linear Mode