Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
5
Answers
How to store image in Sql Server Database using C# ?
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Prafulla Choudhary
11y
1.5k
1
Reply
Dear All
I am try to convert image in byte then insert it into Database using C#.Below is my code .........
public byte[] getImageData(string strFleNm)
{
byte[] ImgData = null;
FileInfo fileinfo = new FileInfo(strFleNm);
long imagefilelenght = strFleNm.Length;
FileStream Fs = new FileStream(strFleNm, FileMode.Open, FileAccess.Read);
BinaryReader Br = new BinaryReader(Fs);
ImgData = Br.ReadBytes((int)imagefilelenght);
return ImgData;
}
but its give error,Error is like Could not find image .....................
Post
Reset
Cancel
Answers (
5
)
Next Recommended Forum
How to use Ajax Calender Extender Control?
Runtime Error