CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #1
    Join Date
    May 1999
    Location
    G day Mayt Land
    Posts
    971

    [RESOLVED] Excel & reading cells content

    I have functions that use
    OleDbCommand , OleDbDataReader and OleDbCommand
    to read values of cells within an excel sheet.

    it works fine for everything else , however in some cases like:
    Row 12-15 ,Column Z , it returns null and i have no idea why
    What is about these cells that is giving me the grief ..

    Cheers

    Code:
                OleDbCommand query = new OleDbCommand(strSql, connection);
                reader = query.ExecuteReader();
    // blaa blaa
                while (reader.Read())
                {
                    foreach(string column in columns)
                    {
                        iColumn++;
                        string x = null;
                        try
                        {
                            x = reader[column].ToString();
    Attached Files Attached Files
    Last edited by Saeed; March 12th, 2010 at 12:19 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured