Click here to Skip to main content
15,793,546 members
Home / Discussions / C#
   

C#

 
AnswerRe: .NET and c# windows form app Pin
OriginalGriff9-Aug-22 1:36
mvaOriginalGriff9-Aug-22 1:36 
AnswerRe: .NET and c# windows form app Pin
Gerry Schmitz9-Aug-22 10:19
mveGerry Schmitz9-Aug-22 10:19 
QuestionDecoding GBK, .NET 6 edition Pin
harold aptroot8-Aug-22 13:07
harold aptroot8-Aug-22 13:07 
AnswerRe: Decoding GBK, .NET 6 edition Pin
lmoelleb8-Aug-22 23:02
lmoelleb8-Aug-22 23:02 
GeneralRe: Decoding GBK, .NET 6 edition Pin
lmoelleb9-Aug-22 0:22
lmoelleb9-Aug-22 0:22 
AnswerRe: Decoding GBK, .NET 6 edition Pin
Richard Deeming8-Aug-22 23:34
mveRichard Deeming8-Aug-22 23:34 
GeneralRe: Decoding GBK, .NET 6 edition Pin
harold aptroot9-Aug-22 5:44
harold aptroot9-Aug-22 5:44 
QuestionHow to close FileStream without causing an error in PdfViewer Pin
Code4Ever7-Aug-22 21:02
Code4Ever7-Aug-22 21: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 21:25
mvaOriginalGriff7-Aug-22 21:25 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
Code4Ever7-Aug-22 21:38
Code4Ever7-Aug-22 21:38 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 22:16
mvaOriginalGriff7-Aug-22 22:16 
GeneralRe: How to close FileStream without causing an error in PdfViewer Pin
OriginalGriff7-Aug-22 22:59
mvaOriginalGriff7-Aug-22 22:59 
AnswerRe: How to close FileStream without causing an error in PdfViewer Pin
Richard Deeming8-Aug-22 1:08
mveRichard Deeming8-Aug-22 1:08 
QuestionFacing problem when calling store procedure from c# code Pin
Mou_kol2-Aug-22 8:52
Mou_kol2-Aug-22 8:52 
AnswerRe: Facing problem when calling store procedure from c# code Pin
Richard Deeming2-Aug-22 22:21
mveRichard Deeming2-Aug-22 22:21 
GeneralRe: Facing problem when calling store procedure from c# code Pin
Mou_kol3-Aug-22 4:27
Mou_kol3-Aug-22 4:27 
GeneralRe: Facing problem when calling store procedure from c# code Pin
Victor Nijegorodov3-Aug-22 6:33
Victor Nijegorodov3-Aug-22 6:33 
QuestionRe: Facing problem when calling store procedure from c# code Pin
thatraja2-Aug-22 22:36
professionalthatraja2-Aug-22 22:36 
AnswerRe: Facing problem when calling store procedure from c# code Pin
Gerry Schmitz3-Aug-22 6:58
mveGerry Schmitz3-Aug-22 6:58 
QuestionHow to dispose Interaction.Behaviors in WPF Pin
Code4Ever2-Aug-22 6:45
Code4Ever2-Aug-22 6:45 
AnswerRe: How to dispose Interaction.Behaviors in WPF Pin
Gerry Schmitz2-Aug-22 7:21
mveGerry Schmitz2-Aug-22 7:21 
QuestionHow to set null value to a FOREIGN KEY using EF Core Pin
Code4Ever31-Jul-22 21:38
Code4Ever31-Jul-22 21:38 
AnswerRe: How to set null value to a FOREIGN KEY using EF Core Pin
Richard MacCutchan31-Jul-22 22:37
mveRichard MacCutchan31-Jul-22 22:37 
GeneralRe: How to set null value to a FOREIGN KEY using EF Core Pin
Code4Ever31-Jul-22 22:49
Code4Ever31-Jul-22 22:49 
GeneralRe: How to set null value to a FOREIGN KEY using EF Core Pin
Richard MacCutchan31-Jul-22 23:06
mveRichard MacCutchan31-Jul-22 23: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.