Click here to Skip to main content
15,898,769 members
Home / Discussions / C#
   

C#

 
AnswerRe: Operator | | Pin
PIEBALDconsult24-Apr-09 4:01
mvePIEBALDconsult24-Apr-09 4:01 
Questionsending SMS from PC through USB port Pin
invisible_eagle23-Apr-09 12:43
invisible_eagle23-Apr-09 12:43 
AnswerRe: sending SMS from PC through USB port Pin
akyriako7824-Apr-09 1:45
akyriako7824-Apr-09 1:45 
QuestionReading from excel.. Pin
Jacob Dixon23-Apr-09 10:44
Jacob Dixon23-Apr-09 10:44 
AnswerRe: Reading from excel.. [modified] Pin
fly90423-Apr-09 11:27
fly90423-Apr-09 11:27 
GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 13:38
Jacob Dixon24-Apr-09 13:38 
GeneralRe: Reading from excel.. Pin
fly90424-Apr-09 14:08
fly90424-Apr-09 14:08 
GeneralRe: Reading from excel.. Pin
fly90424-Apr-09 14:48
fly90424-Apr-09 14:48 
Im not sure if it will work or not but you may be able to select the columns using GetOleDbSchemaTable().

Then use those columns in the select query,

private string[] _GetColumnsFromWorkseet(string sheetname, out string errorMessage)
{
    try
    {
        List<string> ls = new List<string>();

        DataTable dtCols = _oleDbConn.GetOleDbSchemaTable(OleDbSchemaGuid.Columns,
                new Object[] { null, null, sheetname, null });

        foreach (DataRow dr in dtCols.Select(string.Empty, "ORDINAL_POSITION"))
            ls.Add(dr["COLUMN_NAME"].ToString());

        errorMessage = string.Empty;
        return ls.ToArray();
    }
    catch (Exception ex)
    {
        errorMessage = ex.Message;
        return null;
    }
}


My failometer is detecting vast quantities of FAIL!

modified on Friday, April 24, 2009 10:20 PM

GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 14:50
Jacob Dixon24-Apr-09 14:50 
AnswerRe: Reading from excel.. Pin
Ashfield23-Apr-09 20:56
Ashfield23-Apr-09 20:56 
GeneralRe: Reading from excel.. Pin
Jacob Dixon24-Apr-09 13:38
Jacob Dixon24-Apr-09 13:38 
GeneralRe: Reading from excel.. Pin
Ashfield25-Apr-09 7:34
Ashfield25-Apr-09 7:34 
Questionhow to select mulitiple files for upload Pin
T_Teef23-Apr-09 10:10
T_Teef23-Apr-09 10:10 
AnswerRe: how to select mulitiple files for upload Pin
Christian Graus23-Apr-09 10:21
protectorChristian Graus23-Apr-09 10:21 
QuestionProcess.Start is eating spaces Pin
Miszou23-Apr-09 10:06
Miszou23-Apr-09 10:06 
AnswerRe: Process.Start is eating spaces Pin
fly90423-Apr-09 12:04
fly90423-Apr-09 12:04 
GeneralRe: Process.Start is eating spaces Pin
Miszou23-Apr-09 13:23
Miszou23-Apr-09 13:23 
GeneralRe: Process.Start is eating spaces Pin
fly90423-Apr-09 15:23
fly90423-Apr-09 15:23 
Questionurl issue Pin
Zafar Sultan23-Apr-09 7:18
Zafar Sultan23-Apr-09 7:18 
AnswerRe: url issue Pin
Christian Graus23-Apr-09 11:02
protectorChristian Graus23-Apr-09 11:02 
QuestionCannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 6:46
Gindi Bar Yahav23-Apr-09 6:46 
AnswerRe: Cannot connect into SQL Server using C# Pin
Eddy Vluggen23-Apr-09 6:49
professionalEddy Vluggen23-Apr-09 6:49 
GeneralRe: Cannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 6:58
Gindi Bar Yahav23-Apr-09 6:58 
AnswerRe: Cannot connect into SQL Server using C# Pin
Eddy Vluggen23-Apr-09 7:18
professionalEddy Vluggen23-Apr-09 7:18 
GeneralRe: Cannot connect into SQL Server using C# Pin
Gindi Bar Yahav23-Apr-09 7:28
Gindi Bar Yahav23-Apr-09 7:28 

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.