Click here to Skip to main content
15,924,507 members
Home / Discussions / C#
   

C#

 
GeneralRe: Nearest point on a line. Pin
musefan18-Mar-09 6:03
musefan18-Mar-09 6:03 
AnswerRe: Nearest point on a line. Pin
led mike18-Mar-09 5:01
led mike18-Mar-09 5:01 
AnswerRe: Nearest point on a line. Pin
moon_stick18-Mar-09 5:08
moon_stick18-Mar-09 5:08 
AnswerRe: Nearest point on a line. Pin
harold aptroot18-Mar-09 5:25
harold aptroot18-Mar-09 5:25 
Questionmerge using C# Pin
StoneCOLD70918-Mar-09 4:44
StoneCOLD70918-Mar-09 4:44 
AnswerRe: merge using C# Pin
musefan18-Mar-09 4:58
musefan18-Mar-09 4:58 
GeneralRe: merge using C# Pin
StoneCOLD70918-Mar-09 6:29
StoneCOLD70918-Mar-09 6:29 
GeneralRe: merge using C# Pin
musefan18-Mar-09 6:44
musefan18-Mar-09 6:44 
As you code sugests you are still only placing the data in the spread sheet in one line of code per column.

so you do the check before you put the data in.

at the end of each loop globally store the values for unit and teamLeader.

then before you insert unit into the spreedsheet, check if its value is the same as the last inserted unit value, if its the same dont insert the data to the spreadsheet.

Do the same for the teamLeader value


some example edit to your code....

object lastUnit = "";
foreach (Dictionary<string, string> row in Product.Rows())
{  
   if(row["unit"] != lastUnit)
   {                                            
       oSheet.get_Range("A" + CurrentRow, "A" + CurrentRow).Formula = row["unit"];
       lastUnit = row["unit"];
   }



...see if this change works for the unit column. you will want to change the type of lastUnit to whatever type row["unit"] is

Life goes very fast. Tomorrow, today is already yesterday.

GeneralRe: merge using C# Pin
StoneCOLD70918-Mar-09 7:15
StoneCOLD70918-Mar-09 7:15 
GeneralRe: merge using C# Pin
musefan18-Mar-09 7:28
musefan18-Mar-09 7:28 
GeneralRe: merge using C# [modified] Pin
StoneCOLD70918-Mar-09 8:04
StoneCOLD70918-Mar-09 8:04 
Questionerror while inserting table with autonumber using MsAccess Pin
sakthi06karthi18-Mar-09 3:51
sakthi06karthi18-Mar-09 3:51 
AnswerRe: error while inserting table with autonumber using MsAccess Pin
Jerry.Wang18-Mar-09 3:58
Jerry.Wang18-Mar-09 3:58 
GeneralRe: error while inserting table with autonumber using MsAccess Pin
sakthi06karthi18-Mar-09 4:06
sakthi06karthi18-Mar-09 4:06 
GeneralRe: error while inserting table with autonumber using MsAccess Pin
sakthi06karthi18-Mar-09 4:09
sakthi06karthi18-Mar-09 4:09 
GeneralRe: error while inserting table with autonumber using MsAccess Pin
Xmen Real 18-Mar-09 4:12
professional Xmen Real 18-Mar-09 4:12 
AnswerRe: error while inserting table with autonumber using MsAccess Pin
musefan18-Mar-09 4:19
musefan18-Mar-09 4:19 
QuestionCopying embedded powerpoint object from richtextbox into powerpoint Pin
mailtogj18-Mar-09 3:33
mailtogj18-Mar-09 3:33 
QuestionExecute a C# App without installing .Net Framework ! Pin
Mohammad Dayyan18-Mar-09 3:08
Mohammad Dayyan18-Mar-09 3:08 
AnswerRe: Execute a C# App without installing .Net Framework ! Pin
musefan18-Mar-09 3:12
musefan18-Mar-09 3:12 
GeneralRe: Execute a C# App without installing .Net Framework ! Pin
Mohammad Dayyan18-Mar-09 3:26
Mohammad Dayyan18-Mar-09 3:26 
GeneralRe: Execute a C# App without installing .Net Framework ! Pin
musefan18-Mar-09 3:40
musefan18-Mar-09 3:40 
GeneralRe: Execute a C# App without installing .Net Framework ! Pin
Mohammad Dayyan18-Mar-09 3:43
Mohammad Dayyan18-Mar-09 3:43 
GeneralRe: Execute a C# App without installing .Net Framework ! Pin
Xmen Real 18-Mar-09 3:49
professional Xmen Real 18-Mar-09 3:49 
AnswerRe: Execute a C# App without installing .Net Framework ! Pin
Jerry.Wang18-Mar-09 3:13
Jerry.Wang18-Mar-09 3:13 

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.