Click here to Skip to main content
15,881,898 members
Home / Discussions / C#
   

C#

 
AnswerRe: .NET and c# windows form app Pin
OriginalGriff9-Aug-22 0:36
mveOriginalGriff9-Aug-22 0:36 
AnswerRe: .NET and c# windows form app Pin
Gerry Schmitz9-Aug-22 9:19
mveGerry Schmitz9-Aug-22 9:19 
QuestionDecoding GBK, .NET 6 edition Pin
harold aptroot8-Aug-22 12:07
harold aptroot8-Aug-22 12:07 
AnswerRe: Decoding GBK, .NET 6 edition Pin
lmoelleb8-Aug-22 22:02
lmoelleb8-Aug-22 22:02 
GeneralRe: Decoding GBK, .NET 6 edition Pin
lmoelleb8-Aug-22 23:22
lmoelleb8-Aug-22 23:22 
AnswerRe: Decoding GBK, .NET 6 edition Pin
Richard Deeming8-Aug-22 22:34
mveRichard Deeming8-Aug-22 22:34 
GeneralRe: Decoding GBK, .NET 6 edition Pin
harold aptroot9-Aug-22 4:44
harold aptroot9-Aug-22 4:44 
QuestionHow to close FileStream without causing an error in PdfViewer Pin
Code4Ever7-Aug-22 20:02
Code4Ever7-Aug-22 20:02 
I'm using Syncfusion PdfViewer in my project. When I click an item in a list, the related pdf file is loaded and shown in the PdfViewer:

private void PdfReport(string address)
{
    //Load the stream from the local system.
    FileStream fs = new FileStream(address, FileMode.Open);
    PdfSource = fs;
}


The problem is that each time I load a pdf file, a new instance of FileStream is created and the memory usage increases. When I try to dispose FileStream like the following code, the pdf is not shown in the viewer:

private void PdfReport(string address)
{
    //Load the stream from the local system.
    FileStream fs = new FileStream(address, FileMode.Open);
    PdfSource = fs;
    fs.Dispose();
}


How can I solve this problem?

modified 8-Aug-22 2:14am.

AnswerRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 20:25
mveOriginalGriff7-Aug-22 20:25 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
Code4Ever7-Aug-22 20:38
Code4Ever7-Aug-22 20:38 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 21:16
mveOriginalGriff7-Aug-22 21:16 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 21:59
mveOriginalGriff7-Aug-22 21:59 
AnswerRe: How to close FileStream without causing an error in PdfViewer Pin
Richard Deeming8-Aug-22 0:08
mveRichard Deeming8-Aug-22 0:08 
QuestionFacing problem when calling store procedure from c# code Pin
Mou_kol2-Aug-22 7:52
Mou_kol2-Aug-22 7:52 
AnswerRe: Facing problem when calling store procedure from c# code Pin
Richard Deeming2-Aug-22 21:21
mveRichard Deeming2-Aug-22 21:21 
GeneralRe: Facing problem when calling store procedure from c# code Pin
Mou_kol3-Aug-22 3:27
Mou_kol3-Aug-22 3:27 
GeneralRe: Facing problem when calling store procedure from c# code Pin
Victor Nijegorodov3-Aug-22 5:33
Victor Nijegorodov3-Aug-22 5:33 
QuestionRe: Facing problem when calling store procedure from c# code Pin
thatraja2-Aug-22 21:36
professionalthatraja2-Aug-22 21:36 
AnswerRe: Facing problem when calling store procedure from c# code Pin
Gerry Schmitz3-Aug-22 5:58
mveGerry Schmitz3-Aug-22 5:58 
QuestionHow to dispose Interaction.Behaviors in WPF Pin
Code4Ever2-Aug-22 5:45
Code4Ever2-Aug-22 5:45 
AnswerRe: How to dispose Interaction.Behaviors in WPF Pin
Gerry Schmitz2-Aug-22 6:21
mveGerry Schmitz2-Aug-22 6:21 
QuestionHow to set null value to a FOREIGN KEY using EF Core Pin
Code4Ever31-Jul-22 20:38
Code4Ever31-Jul-22 20:38 
AnswerRe: How to set null value to a FOREIGN KEY using EF Core Pin
Richard MacCutchan31-Jul-22 21:37
mveRichard MacCutchan31-Jul-22 21:37 
GeneralRe: How to set null value to a FOREIGN KEY using EF Core Pin
Code4Ever31-Jul-22 21:49
Code4Ever31-Jul-22 21:49 
GeneralRe: How to set null value to a FOREIGN KEY using EF Core Pin
Richard MacCutchan31-Jul-22 22:06
mveRichard MacCutchan31-Jul-22 22:06 

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.