Click here to Skip to main content
15,884,877 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to connect to XP machine using vb.net Pin
LloydA11131-Aug-09 15:34
LloydA11131-Aug-09 15:34 
QuestionHow we Drawing a Chart in Form Pin
faravani29-Aug-09 1:16
faravani29-Aug-09 1:16 
AnswerRe: How we Drawing a Chart in Form Pin
Luc Pattyn29-Aug-09 1:21
sitebuilderLuc Pattyn29-Aug-09 1:21 
QuestionMissingMethodException mobile aplication Pin
Anubhava Dimri29-Aug-09 1:10
Anubhava Dimri29-Aug-09 1:10 
QuestionHow to get XPath to XML node from treeview node? Pin
korell28-Aug-09 8:19
korell28-Aug-09 8:19 
AnswerRe: How to get XPath to XML node from treeview node? Pin
DidiKunz31-Aug-09 3:01
DidiKunz31-Aug-09 3:01 
AnswerRe: How to get XPath to XML node from treeview node? Pin
korell31-Aug-09 4:46
korell31-Aug-09 4:46 
QuestionCrystal Reports Dynamic Image from DB Pin
eddieangel28-Aug-09 6:42
eddieangel28-Aug-09 6:42 
Good morning, I have used the following code to dynamically load an image into my crystal report (Windows Application Crystal report viewer), but when trying to print it I run out of memory after 20 pages (40 images) or so and the application breaks down. (background processing error)

Is there a way to free up the memory after I print a page or after the image is loaded?

Private Sub frmPhotoBook_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.DtPhotoBookTA.Fill(Me.DsRptPhotoBook.dtPhotoBook, myCaseId)

Dim cryRpt As New ReportDocument
cryRpt.Load(Windows.Forms.Application.StartupPath & "\rptPhotoBook.rpt")

For index As Int16 = 0 To (DsRptPhotoBook.Tables("dtPhotoBook").Rows.Count - 1) Step 1
If DsRptPhotoBook.Tables("dtPhotoBook").Rows(index).Item("txtPictureId").ToString <> "" Then
If System.IO.File.Exists(DsRptPhotoBook.Tables("dtPhotoBook").Rows(index).Item("txtPicPath") & DsRptPhotoBook.Tables("dtPhotoBook").Rows(index).Item("txtPictureId")) Then
LoadImage(DsRptPhotoBook.Tables("dtPhotoBook").Rows(index), "img", DsRptPhotoBook.Tables("dtPhotoBook").Rows(index).Item("txtPicPath") & DsRptPhotoBook.Tables("dtPhotoBook").Rows(index).Item("txtPictureId"))
End If
End If
Next
cryRpt.DataSourceConnections(0).SetConnection("xxxxxx", "xxxxxx", "xxxxxx", "xxxxxx")
cryRpt.SetDataSource(DsRptPhotoBook)

Me.CrystalReportViewer1.ReportSource = cryRpt
Me.CrystalReportViewer1.Refresh()
Me.CrystalReportViewer1.Zoom(75)

End Sub

Private Sub LoadImage(ByVal objDataRow As DataRow, ByVal imageField As String, ByVal filePath As String)
Try
Dim fs As New System.IO.FileStream(filePath, IO.FileMode.Open, IO.FileAccess.Read)
Dim image(fs.Length) As Byte

fs.Read(image, 0, Convert.ToInt32(fs.Length))
fs.Close()
objDataRow(imageField) = image
fs.Dispose()

Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
QuestionUpdate button is greyed out Pin
Buggedforever27-Aug-09 23:19
Buggedforever27-Aug-09 23:19 
AnswerRe: Update button is greyed out Pin
DoctorMick28-Aug-09 0:36
DoctorMick28-Aug-09 0:36 
AnswerRe: Update button is greyed out Pin
Jay Royall28-Aug-09 0:38
Jay Royall28-Aug-09 0:38 
AnswerRe: Update button is greyed out Pin
Dave Kreskowiak28-Aug-09 3:20
mveDave Kreskowiak28-Aug-09 3:20 
GeneralRe: Update button is greyed out Pin
Steven J Jowett28-Aug-09 4:47
Steven J Jowett28-Aug-09 4:47 
GeneralRe: Update button is greyed out Pin
Dave Kreskowiak28-Aug-09 7:05
mveDave Kreskowiak28-Aug-09 7:05 
QuestionControlling IE through VBA in an Excel Macro [modified] Pin
adityabaraya27-Aug-09 23:15
adityabaraya27-Aug-09 23:15 
AnswerRe: Controlling IE through VBA in an Excel Macro Pin
Dave Kreskowiak28-Aug-09 3:16
mveDave Kreskowiak28-Aug-09 3:16 
GeneralRe: Controlling IE through VBA in an Excel Macro Pin
adityabaraya30-Aug-09 18:41
adityabaraya30-Aug-09 18:41 
QuestionHow to save result of an querry in a variable in VB? Pin
swatinz27-Aug-09 20:35
swatinz27-Aug-09 20:35 
AnswerRe: How to save result of an querry in a variable in VB? Pin
Ashfield27-Aug-09 21:01
Ashfield27-Aug-09 21:01 
GeneralRe: How to save result of an querry in a variable in VB? Pin
swatinz27-Aug-09 21:04
swatinz27-Aug-09 21:04 
GeneralRe: How to save result of an querry in a variable in VB? Pin
Ashfield28-Aug-09 1:13
Ashfield28-Aug-09 1:13 
QuestionCom ports Pin
RyJaBy27-Aug-09 11:16
RyJaBy27-Aug-09 11:16 
AnswerRe: Com ports Pin
Luc Pattyn27-Aug-09 11:47
sitebuilderLuc Pattyn27-Aug-09 11:47 
QuestionNeed help- Connect to Access db-VB.Net 64bit Pin
valkyriexp27-Aug-09 10:39
valkyriexp27-Aug-09 10:39 
AnswerRe: Need help- Connect to Access db-VB.Net 64bit Pin
Kschuler27-Aug-09 11:05
Kschuler27-Aug-09 11:05 

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.