Click here to Skip to main content
15,917,859 members
Home / Discussions / C#
   

C#

 
GeneralRe: Getting file names from a web site Pin
Yusuf11-Aug-08 2:33
Yusuf11-Aug-08 2:33 
GeneralRe: Getting file names from a web site Pin
Richard W Allen11-Aug-08 3:42
Richard W Allen11-Aug-08 3:42 
AnswerRe: Getting file names from a web site Pin
Paul Conrad8-Aug-08 12:19
professionalPaul Conrad8-Aug-08 12:19 
Questionc# API to handle Microsoft word document file format Pin
Miss_hacker8-Aug-08 10:26
Miss_hacker8-Aug-08 10:26 
AnswerRe: c# API to handle Microsoft word document file format Pin
Pete O'Hanlon8-Aug-08 10:32
mvePete O'Hanlon8-Aug-08 10:32 
GeneralRe: c# API to handle Microsoft word document file format Pin
Paul Conrad8-Aug-08 10:54
professionalPaul Conrad8-Aug-08 10:54 
GeneralRe: c# API to handle Microsoft word document file format Pin
Miss_hacker8-Aug-08 11:02
Miss_hacker8-Aug-08 11:02 
AnswerRe: c# API to handle Microsoft word document file format Pin
Paul Conrad8-Aug-08 10:57
professionalPaul Conrad8-Aug-08 10:57 
GeneralRe: c# API to handle Microsoft word document file format Pin
Miss_hacker8-Aug-08 11:12
Miss_hacker8-Aug-08 11:12 
GeneralRe: c# API to handle Microsoft word document file format Pin
Pete O'Hanlon8-Aug-08 11:50
mvePete O'Hanlon8-Aug-08 11:50 
GeneralRe: c# API to handle Microsoft word document file format Pin
Christian Graus8-Aug-08 16:58
protectorChristian Graus8-Aug-08 16:58 
GeneralRe: c# API to handle Microsoft word document file format Pin
Paul Conrad8-Aug-08 12:17
professionalPaul Conrad8-Aug-08 12:17 
GeneralRe: c# API to handle Microsoft word document file format Pin
Christian Graus8-Aug-08 16:58
protectorChristian Graus8-Aug-08 16:58 
GeneralRe: c# API to handle Microsoft word document file format Pin
Paul Conrad8-Aug-08 19:31
professionalPaul Conrad8-Aug-08 19:31 
GeneralRe: c# API to handle Microsoft word document file format Pin
Miss_hacker8-Aug-08 20:37
Miss_hacker8-Aug-08 20:37 
GeneralRe: c# API to handle Microsoft word document file format Pin
Cruel Handsome22-Aug-08 2:41
Cruel Handsome22-Aug-08 2:41 
GeneralRe: c# API to handle Microsoft word document file format Pin
Miss_hacker22-Aug-08 3:31
Miss_hacker22-Aug-08 3:31 
Questionpaste possibility Pin
netJP12L8-Aug-08 9:28
netJP12L8-Aug-08 9:28 
QuestionIndexOutOfRangeException - DbCommand / DbDataReader numeric column name Pin
dataminers8-Aug-08 9:18
dataminers8-Aug-08 9:18 
I read excel file using following code. This code properly work when columnName variable is not numeric value. If columnName varibale is numeric for example columnName = "1"; so I get IndexOutOfRangeException. Under the while loop, in this line myList.Add(dr[columnName].ToString());

//columnName is string parameter

string connectionString = "....."
List<string> myList = new List<string>();
DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");

using (DbConnection connection = factory.CreateConnection())
{
connection.ConnectionString = connectionString;
using (DbCommand command = connection.CreateCommand())
{
string sql = "SELECT " + columnName + " FROM [Test$]";
command.CommandText = sql;
connection.Open();
using (DbDataReader dr = command.ExecuteReader())
{
while (dr.Read())
{
myList.Add(dr[columnName].ToString());
}
dr.Close();
}
}
}

What can I do.
Best Regards...
AnswerRe: IndexOutOfRangeException - DbCommand / DbDataReader numeric column name Pin
Guffa8-Aug-08 9:38
Guffa8-Aug-08 9:38 
GeneralRe: IndexOutOfRangeException - DbCommand / DbDataReader numeric column name Pin
dataminers8-Aug-08 22:13
dataminers8-Aug-08 22:13 
Questionfilewatcher to invoke servcie after a file is fully copied Pin
balu123458-Aug-08 8:12
balu123458-Aug-08 8:12 
Questionfile Copy from system to another system in C#.net Pin
balu123458-Aug-08 8:02
balu123458-Aug-08 8:02 
AnswerRe: file Copy from system to another system in C#.net Pin
vikas amin8-Aug-08 9:38
vikas amin8-Aug-08 9:38 
GeneralRe: file Copy from system to another system in C#.net Pin
balu123458-Aug-08 20:44
balu123458-Aug-08 20:44 

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.