locked
How to dynamically set TypeGuessRows RRS feed

  • Question

  • User-1291236382 posted
    Is there a way to set TypeGuessRows for a specific connection, for example by setting a connection string property?
    Sunday, January 24, 2016 11:33 PM

All replies

  • User-271186128 posted

    Hi orlando.colamatteo,

    Here are some relevant articles about setting the value of the TypeGuessRows registry key, you could refer to them:

    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/ce095b10-84a4-4ae3-8944-70a2b53daa44/mixed-data-types-in-excel-column-to-oedb-destination?forum=sqlintegrationservices

    https://support.microsoft.com/en-us/kb/189897

    If you want to dynamic change the connection string, I suggest you could add multiple connection string in web.config file, then use the following code to change it:

    if ("YOUR CONDITION HERE") 
    { 
      SqlDataSource1.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["connStringLIVE"].ConnectionString; 
    }
    else
    {
       SqlDataSource1.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["connStringTEST"].ConnectionString; 
    } 
    

    Best regards,
    Dillion

    Monday, January 25, 2016 5:57 AM
  • User-1291236382 posted
    Thanks for reading my question carefully and thinking about the issue. I am looking for a way to set the number of rows the driver will read at runtime,
    without changing the registry, e.g. at the connection level.

    From a portability standpoint the registry setting is not a solution plus the scope of the change is not granular enough to prevent unintended impacts to other processes without widespread regression testing.
    Monday, January 25, 2016 3:34 PM