Click here to Skip to main content
15,893,266 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Its Very Urgent Pin
Paul Conrad23-Jul-07 11:47
professionalPaul Conrad23-Jul-07 11:47 
GeneralRe: Its Very Urgent Pin
Psycho-*Coder*-Extreme23-Jul-07 10:40
Psycho-*Coder*-Extreme23-Jul-07 10:40 
GeneralRe: Its Very Urgent Pin
Psycho-*Coder*-Extreme23-Jul-07 11:05
Psycho-*Coder*-Extreme23-Jul-07 11:05 
GeneralRe: Its Very Urgent Pin
Dave Kreskowiak23-Jul-07 12:08
mveDave Kreskowiak23-Jul-07 12:08 
GeneralRe: Its Very Urgent Pin
Psycho-*Coder*-Extreme23-Jul-07 14:12
Psycho-*Coder*-Extreme23-Jul-07 14:12 
Questionole object Pin
ellllllllie15-Jul-07 20:17
ellllllllie15-Jul-07 20:17 
AnswerRe: ole object Pin
Eduard Keilholz16-Jul-07 1:10
Eduard Keilholz16-Jul-07 1:10 
AnswerRe: ole object Pin
Kschuler16-Jul-07 9:16
Kschuler16-Jul-07 9:16 
I disagree with the other guy...I mean, he has a point. But sometimes you really do need to store an image in a db. You may just have to figure out a way to work around the slow down...so it's important to keep that in mind.
I work with VB not C#, but it's pretty close so you should be able to figure it out from what I give you. Basically, you need to turn the image file into an array of bytes. So your table should contain a blob column, or a column that will hold an array of bytes. So, your code would look something like this

Dim dt as New DataTable<br />
'Either fill dt with schema from access db or add column like below...<br />
dt.Columns.Add("ImageColumn", System.Type.GetType("System.Byte[]"))<br />
<br />
Dim strImageLocation as String = "C:\My Image.gif"<br />
If System.IO.File.Exists(strImageLocation) Then 'Make sure the image file exists<br />
    Dim rowNew As DataRow = dt.NewRow<br />
    rowNew("ImageColumn") = System.IO.File.ReadAllBytes(strImageLocation)<br />
    dt.Rows.Add(rowNew)<br />
End If


Hope this helps.
QuestionEdit functionalities in Combobox Pin
atulagarwal5615-Jul-07 19:34
atulagarwal5615-Jul-07 19:34 
AnswerRe: Edit functionalities in Combobox Pin
Manas Bhardwaj16-Jul-07 0:25
professionalManas Bhardwaj16-Jul-07 0:25 
GeneralRe: Edit functionalities in Combobox Pin
atulagarwal5617-Jul-07 8:24
atulagarwal5617-Jul-07 8:24 
AnswerRe: Edit functionalities in Combobox Pin
Mike Dimmick16-Jul-07 6:11
Mike Dimmick16-Jul-07 6:11 
GeneralMaster Detail Pin
Brady Kelly13-Jul-07 5:09
Brady Kelly13-Jul-07 5:09 
QuestionDatagridview Pin
phantanagu12-Jul-07 23:39
phantanagu12-Jul-07 23:39 
AnswerRe: Datagridview Pin
SHatchard13-Jul-07 1:21
SHatchard13-Jul-07 1:21 
Questionhow i can make that cursor will not show at all in read only text box? Pin
tomertro11-Jul-07 20:00
tomertro11-Jul-07 20:00 
AnswerRe: how i can make that cursor will not show at all in read only text box? Pin
Alpesh Donga11-Jul-07 20:13
Alpesh Donga11-Jul-07 20:13 
GeneralRe: how i can make that cursor will not show at all in read only text box? Pin
RepliCrux11-Jul-07 20:30
RepliCrux11-Jul-07 20:30 
GeneralRe: how i can make that cursor will not show at all in read only text box? Pin
Colin Angus Mackay11-Jul-07 23:20
Colin Angus Mackay11-Jul-07 23:20 
QuestionRe: how i can make that cursor will not show at all in read only text box? Pin
tomertro11-Jul-07 20:55
tomertro11-Jul-07 20:55 
AnswerRe: how i can make that cursor will not show at all in read only text box? Pin
Colin Angus Mackay11-Jul-07 23:20
Colin Angus Mackay11-Jul-07 23:20 
GeneralRe: how i can make that cursor will not show at all in read only text box? Pin
tomertro12-Jul-07 1:12
tomertro12-Jul-07 1:12 
AnswerRe: how i can make that cursor will not show at all in read only text box? Pin
Giorgi Dalakishvili11-Jul-07 23:36
mentorGiorgi Dalakishvili11-Jul-07 23:36 
GeneralRe: how i can make that cursor will not show at all in read only text box? Pin
tomertro12-Jul-07 1:07
tomertro12-Jul-07 1:07 
GeneralRe: how i can make that cursor will not show at all in read only text box? Pin
Giorgi Dalakishvili12-Jul-07 1:10
mentorGiorgi Dalakishvili12-Jul-07 1:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.