1 Replies - 2045 Views - Last Post: 03 April 2009 - 06:46 PM Rate Topic: -----

#1 liquidkool  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 03-April 09

Data Field limit 255 characters?

Posted 03 April 2009 - 03:57 PM

I am updating an excel spreadsheet .xsl no .xslx using the code below. The problem I am having is that the field will not allow more than 255 characters.

How do I update the field size?


        string connectionString = _tempConnectionString;
        DbProviderFactory factory = DbProviderFactories.GetFactory("System.Data.OleDb");
        using (DbConnection connection = factory.CreateConnection())
        {
            connection.ConnectionString = connectionString;

            using (DbCommand command = connection.CreateCommand())
            {
               command.CommandText = "INSERT INTO [Sheet1$]([String Name],[String Value]) VALUES(\"" + strName + "\",\"" + strValue + "\")";
               connection.Open();
               command.ExecuteNonQuery();
            }
            connection.Close();
        }

This post has been edited by JackOfAllTrades: 03 April 2009 - 06:44 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Data Field limit 255 characters?

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6064
  • View blog
  • Posts: 23,520
  • Joined: 23-August 08

Re: Data Field limit 255 characters?

Posted 03 April 2009 - 06:46 PM

I think that's a limitation of Excel. It's not like Excel is a real database or anything.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1