Click here to Skip to main content
16,018,202 members
Home / Discussions / C#
   

C#

 
AnswerRe: Stop while loop Pin
Dino Mulahusic9-Apr-09 0:11
professionalDino Mulahusic9-Apr-09 0:11 
AnswerRe: Stop while loop Pin
Rob Philpott9-Apr-09 0:16
Rob Philpott9-Apr-09 0:16 
GeneralRe: Stop while loop Pin
yesu prakash9-Apr-09 0:19
yesu prakash9-Apr-09 0:19 
GeneralRe: Stop while loop Pin
Rob Philpott9-Apr-09 0:26
Rob Philpott9-Apr-09 0:26 
GeneralRe: Stop while loop Pin
Deresen9-Apr-09 2:57
Deresen9-Apr-09 2:57 
GeneralRe: Stop while loop Pin
Rob Philpott9-Apr-09 3:10
Rob Philpott9-Apr-09 3:10 
GeneralRe: Stop while loop Pin
Deresen9-Apr-09 3:16
Deresen9-Apr-09 3:16 
Questionreading excel contents Pin
mist_psycho8-Apr-09 23:30
mist_psycho8-Apr-09 23:30 
I tried using this code for reading excel data using c# :

bt the following part of the code is giving errors and is not being executed....

plz help !!!!


using System;
using System.Collections.Generic;
using System.Text;
using Excel;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
string Path = @"c:\gg.xls";
Excel.ApplicationClass app = new ApplicationClass();


Excel.Workbook workBook =
app.Workbooks.Open(Path,0,true,5,"","",true,Excel.XlPlatform.xlWindows,"\t",false,false,0,true,1,0);



Excel.Worksheet workSheet = (Excel.Worksheet)workBook.ActiveSheet;
int index = 0;

object rowIndex = 2;
object colIndex1 = 1;
object colIndex2 = 2;
try
{
while (((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2 != null)
{
rowIndex = 2 + index;
string firstName = ((Excel.Range)workSheet.Cells[rowIndex, colIndex1]).Value2.ToString();
string lastName = ((Excel.Range)workSheet.Cells[rowIndex, colIndex2]).Value2.ToString();
Console.WriteLine("Name : {0},{1} ", firstName, lastName);
index++;
}
}
catch (Exception ex)
{
app.Quit();
Console.WriteLine(ex.Message);
}
}
}
}


the error is at "Excel.Workbook workBook = app.Workbooks.Open" :

Error 1

No overload for method 'Open' takes '15' arguments C:\Documents and Settings\Administrator\My Documents\Visual Studio 2005\Projects\ConsoleApplication1_trytry\ConsoleApplication1_trytry\Program.cs 16 39 ConsoleApplication1_trytry

AnswerRe: reading excel contents Pin
Rob Philpott9-Apr-09 0:54
Rob Philpott9-Apr-09 0:54 
QuestionGeneric method: Cast an object to a return type T Pin
Spunky Coder8-Apr-09 23:26
Spunky Coder8-Apr-09 23:26 
AnswerRe: Generic method: Cast an object to a return type T Pin
0x3c08-Apr-09 23:37
0x3c08-Apr-09 23:37 
GeneralRe: Generic method: Cast an object to a return type T Pin
_groo_8-Apr-09 23:49
_groo_8-Apr-09 23:49 
GeneralRe: Generic method: Cast an object to a return type T Pin
Spunky Coder8-Apr-09 23:51
Spunky Coder8-Apr-09 23:51 
GeneralRe: Generic method: Cast an object to a return type T Pin
_groo_9-Apr-09 0:01
_groo_9-Apr-09 0:01 
GeneralRe: Generic method: Cast an object to a return type T Pin
Spunky Coder9-Apr-09 0:14
Spunky Coder9-Apr-09 0:14 
AnswerRe: Generic method: Cast an object to a return type T Pin
Rob Philpott8-Apr-09 23:42
Rob Philpott8-Apr-09 23:42 
GeneralRe: Generic method: Cast an object to a return type T Pin
Spunky Coder9-Apr-09 0:01
Spunky Coder9-Apr-09 0:01 
GeneralRe: Generic method: Cast an object to a return type T Pin
Rob Philpott9-Apr-09 0:12
Rob Philpott9-Apr-09 0:12 
GeneralRe: Generic method: Cast an object to a return type T Pin
Spunky Coder9-Apr-09 0:43
Spunky Coder9-Apr-09 0:43 
GeneralRe: Generic method: Cast an object to a return type T Pin
Rob Philpott9-Apr-09 0:46
Rob Philpott9-Apr-09 0:46 
GeneralRe: Generic method: Cast an object to a return type T Pin
Spunky Coder9-Apr-09 1:08
Spunky Coder9-Apr-09 1:08 
GeneralRe: Generic method: Cast an object to a return type T Pin
_groo_9-Apr-09 1:47
_groo_9-Apr-09 1:47 
QuestionAssignability of output parameters in C# Pin
dojohansen8-Apr-09 22:55
dojohansen8-Apr-09 22:55 
AnswerRe: Assignability of output parameters in C# Pin
Rob Philpott8-Apr-09 23:36
Rob Philpott8-Apr-09 23:36 
GeneralRe: Assignability of output parameters in C# Pin
dojohansen9-Apr-09 0:21
dojohansen9-Apr-09 0:21 

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.