Click here to Skip to main content
15,909,953 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: DateTimePicker question Pin
Dalek Dave21-May-09 3:42
professionalDalek Dave21-May-09 3:42 
GeneralRe: DateTimePicker question Pin
Dave Kreskowiak21-May-09 3:45
mveDave Kreskowiak21-May-09 3:45 
GeneralRe: DateTimePicker question *** Answered *** Pin
Laser Steve21-May-09 3:52
Laser Steve21-May-09 3:52 
GeneralRe: DateTimePicker question Pin
Dalek Dave21-May-09 3:55
professionalDalek Dave21-May-09 3:55 
GeneralRe: DateTimePicker question Pin
Dave Kreskowiak21-May-09 4:25
mveDave Kreskowiak21-May-09 4:25 
GeneralRe: DateTimePicker question Pin
Dalek Dave21-May-09 4:32
professionalDalek Dave21-May-09 4:32 
GeneralRe: DateTimePicker question Pin
Dave Kreskowiak21-May-09 6:40
mveDave Kreskowiak21-May-09 6:40 
QuestionLoading image dynamically in crystal report Pin
Ovais Memon21-May-09 0:09
Ovais Memon21-May-09 0:09 
I have a field of Image path on database and I need to display the image of student in crystal report. I am using VS2005 with crystal report version 9. I have added the unbound column named "Image" of type system.byte in Data Set and at the load event, I have write the following code.


Dim da As New DataSet1TableAdapters.AdmissionFormTableAdapter
Dim dt As New DataSet1.AdmissionFormDataTable
da.FillByStudentID(dt, _studentID)
Dim dtCopy As New DataTable


'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Code Start to Set Image
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
Dim blankFile As String = "C:\Program Files\blank.JPG"

If dt.Rows(0).Item("ImagePath").ToString <> "" Then
Dim s As String = dt.Rows(0).Item("ImagePath").ToString
If FileIO.FileSystem.FileExists(s) Then

Dim fs As FileStream = New FileStream(s, FileMode.Open, FileAccess.Read)
Dim image(fs.Length) As Byte

fs.Read(image, 0, Convert.ToInt32(fs.Length))
dt.Rows(0).Item("Image") = image
fs.Close()
Else
Dim fs As FileStream = New FileStream(blankFile, FileMode.Open, FileAccess.Read)
Dim image(fs.Length) As Byte

fs.Read(image, 0, Convert.ToInt32(fs.Length))
dt.Rows(0).Item("Image") = image
fs.Close()
End If
Else
Dim fs As FileStream = New FileStream(blankFile, FileMode.Open, FileAccess.Read)
Dim image(fs.Length) As Byte

fs.Read(image, 0, Convert.ToInt32(fs.Length))
dt.Rows(0).Item("Image") = image
fs.Close()
End If
'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Code End to Set Image
'''''''''''''''''''''''''''''''''''''''''''''''''''''''

dtCopy = dt.Copy
Me.rptAdmissionForm1.SetDataSource(dtCopy)
Me.rptAdmissionForm1.SetParameterValue("ID", _studentID)


When I run the code, error comes that "unable to cast type of system.byte to system.IConvertible",
although the datatype of column "Image" is system.byte, and when I debug the code, it shows the datatype of dt.Rows(0).Item("Image") = System.DBNull, Please help me out..!
AnswerRe: Loading image dynamically in crystal report Pin
Kschuler26-May-09 7:57
Kschuler26-May-09 7:57 
QuestionSend SMS from a VB6 application. Pin
she-Developer20-May-09 23:31
she-Developer20-May-09 23:31 
AnswerRe: Send SMS from a VB6 application. Pin
EliottA21-May-09 3:03
EliottA21-May-09 3:03 
QuestionCyrstal Reports subreport Section hiding Pin
jinxster20-May-09 23:07
professionaljinxster20-May-09 23:07 
AnswerRe: Cyrstal Reports subreport Section hiding Pin
David Mujica21-May-09 3:13
David Mujica21-May-09 3:13 
GeneralRe: Cyrstal Reports subreport Section hiding Pin
jinxster21-May-09 5:53
professionaljinxster21-May-09 5:53 
GeneralRe: Cyrstal Reports subreport Section hiding Pin
David Mujica21-May-09 6:01
David Mujica21-May-09 6:01 
GeneralRe: Cyrstal Reports subreport Section hiding Pin
jinxster21-May-09 6:25
professionaljinxster21-May-09 6:25 
GeneralRe: Cyrstal Reports subreport Section hiding Pin
David Mujica21-May-09 6:29
David Mujica21-May-09 6:29 
GeneralRe: Cyrstal Reports subreport Section hiding Pin
jinxster21-May-09 6:45
professionaljinxster21-May-09 6:45 
AnswerHow are you interacting with Crystal ? Pin
David Mujica21-May-09 8:13
David Mujica21-May-09 8:13 
GeneralRe: How are you interacting with Crystal ? Pin
jinxster21-May-09 18:46
professionaljinxster21-May-09 18:46 
GeneralRe: How are you interacting with Crystal ? Pin
David Mujica22-May-09 3:49
David Mujica22-May-09 3:49 
GeneralRe: How are you interacting with Crystal ? Pin
jinxster22-May-09 18:53
professionaljinxster22-May-09 18:53 
GeneralGreat accomplishment Pin
David Mujica26-May-09 2:32
David Mujica26-May-09 2:32 
QuestionCustome User Control wont work Pin
binjafar20-May-09 22:03
binjafar20-May-09 22:03 
AnswerRe: Custome User Control wont work Pin
Henry Minute21-May-09 1:56
Henry Minute21-May-09 1:56 

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.