Click here to Skip to main content
15,894,460 members
Home / Discussions / C#
   

C#

 
AnswerRe: Write image as Indexed PNG C# Pin
buachaill cliste20-Apr-09 9:07
buachaill cliste20-Apr-09 9:07 
GeneralRe: Write image as Indexed PNG C# Pin
harold aptroot20-Apr-09 9:42
harold aptroot20-Apr-09 9:42 
GeneralRe: Write image as Indexed PNG C# Pin
buachaill cliste20-Apr-09 9:45
buachaill cliste20-Apr-09 9:45 
AnswerRe: Write image as Indexed PNG C# Pin
Luc Pattyn20-Apr-09 10:01
sitebuilderLuc Pattyn20-Apr-09 10:01 
AnswerRe: Write image as Indexed PNG C# Pin
Steve_24-Apr-09 15:41
Steve_24-Apr-09 15:41 
QuestionChange DataType in database Pin
andymo220-Apr-09 6:50
andymo220-Apr-09 6:50 
AnswerRe: Change DataType in database Pin
Mycroft Holmes20-Apr-09 14:27
professionalMycroft Holmes20-Apr-09 14:27 
QuestionError - Attempted to read or write protected memory Pin
Kevin Marois20-Apr-09 6:32
professionalKevin Marois20-Apr-09 6:32 
I had this code working yesterday. Today I get "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."

Here's the code. It errors on the oSheet.SaveAs line:

Microsoft.Office.Interop.Excel.Application oXL;
Microsoft.Office.Interop.Excel._Workbook oWB;
Microsoft.Office.Interop.Excel._Worksheet oSheet;

oXL = new Microsoft.Office.Interop.Excel.Application();
oWB = (Microsoft.Office.Interop.Excel._Workbook)(oXL.Workbooks.Add(Missing.Value));
oSheet = (Microsoft.Office.Interop.Excel._Worksheet)oWB.ActiveSheet;

Reader = new StreamReader(ExportParams.sSourceFileName);

iRow = 0;
sSourceRow = Reader.ReadLine();

while (sSourceRow != null)
{
    iRow++;
    string[] aWords = sSourceRow.Split(',');

    oSheet.Cells[iRow, 1] = aWords[0];
    oSheet.Cells[iRow, 2] = aWords[1];
    oSheet.Cells[iRow, 3] = aWords[2];

    sSourceRow = Reader.ReadLine();
}

Reader.Close();

if (File.Exists(ExportParams.sResultFileName))
{
    File.Delete(ExportParams.sResultFileName);
}

oSheet.SaveAs(ExportParams.sResultFileName,
        Type.Missing,
        Type.Missing,
        Type.Missing,
        Type.Missing,
        Type.Missing,
        Type.Missing,
        Type.Missing,
        Type.Missing,
        Type.Missing);

oXL.Quit();


Everything makes sense in someone's mind

QuestionHow to get System Memory in C#.net windows application? Pin
Narendra Reddy Vajrala20-Apr-09 6:06
Narendra Reddy Vajrala20-Apr-09 6:06 
AnswerRe: How to get System Memory in C#.net windows application? Pin
harold aptroot20-Apr-09 7:11
harold aptroot20-Apr-09 7:11 
AnswerRe: How to get System Memory in C#.net windows application? [modified] Pin
Luc Pattyn20-Apr-09 7:23
sitebuilderLuc Pattyn20-Apr-09 7:23 
QuestionIssue with the GzipStream Class Pin
ramz_g20-Apr-09 5:39
ramz_g20-Apr-09 5:39 
AnswerRe: Issue with the GzipStream Class Pin
Rolando CC20-Apr-09 11:27
professionalRolando CC20-Apr-09 11:27 
GeneralRe: Issue with the GzipStream Class Pin
ramz_g20-Apr-09 19:08
ramz_g20-Apr-09 19:08 
GeneralRe: Issue with the GzipStream Class Pin
Rolando CC21-Apr-09 3:40
professionalRolando CC21-Apr-09 3:40 
GeneralRe: Issue with the GzipStream Class Pin
ramz_g21-Apr-09 7:37
ramz_g21-Apr-09 7:37 
QuestionTableAdapterManager.UpdateAll problem : [ Concurrency violation ] Pin
hdv21220-Apr-09 5:28
hdv21220-Apr-09 5:28 
QuestionIcon in a textbox Pin
edlanka20-Apr-09 4:56
edlanka20-Apr-09 4:56 
AnswerRe: Icon in a textbox Pin
Ian McCaul20-Apr-09 5:26
Ian McCaul20-Apr-09 5:26 
GeneralRe: Icon in a textbox Pin
edlanka20-Apr-09 5:33
edlanka20-Apr-09 5:33 
GeneralRe: Icon in a textbox Pin
Ian McCaul20-Apr-09 5:40
Ian McCaul20-Apr-09 5:40 
GeneralRe: Icon in a textbox Pin
edlanka20-Apr-09 6:49
edlanka20-Apr-09 6:49 
GeneralRe: Icon in a textbox Pin
Mbah Dhaim20-Apr-09 7:15
Mbah Dhaim20-Apr-09 7:15 
GeneralRe: Icon in a textbox Pin
DaveyM6920-Apr-09 8:52
professionalDaveyM6920-Apr-09 8:52 
GeneralRe: Icon in a textbox Pin
Naruki20-Apr-09 17:43
Naruki20-Apr-09 17:43 

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.