System.Data.SQLite
Check-in [3a7fb899f7]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Globalization bugfixes
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 3a7fb899f78b5ae9365727d75ebb6d3708096274
User & Date: rmsimpson 2005-11-10 21:08:39
Context
2005-11-10
21:08
1.0.22.0 check-in: 3591c117aa user: rmsimpson tags: sourceforge
21:08
Globalization bugfixes check-in: 3a7fb899f7 user: rmsimpson tags: sourceforge
2005-11-03
21:11
1.0.21 RTM check-in: ee059e5590 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to System.Data.SQLite/SQLite3.cs.

   315    315   
   316    316       internal override int ColumnIndex(SQLiteStatement stmt, string columnName)
   317    317       {
   318    318         int x = ColumnCount(stmt);
   319    319   
   320    320         for (int n = 0; n < x; n++)
   321    321         {
   322         -        if (String.Compare(columnName, ColumnName(stmt, n), true, CultureInfo.CurrentCulture) == 0)
          322  +        if (String.Compare(columnName, ColumnName(stmt, n), true, CultureInfo.InvariantCulture) == 0)
   323    323             return n;
   324    324         }
   325    325         return -1;
   326    326       }
   327    327   
   328    328       internal override double GetDouble(SQLiteStatement stmt, int index)
   329    329       {

Changes to System.Data.SQLite/SQLiteConnection.cs.

   564    564   
   565    565         if (String.IsNullOrEmpty(strFile))
   566    566           throw new ArgumentException("Data Source cannot be empty.  Use :MEMORY: to open an in-memory database");
   567    567   
   568    568         try
   569    569         {
   570    570           bool bUTF16 = (Convert.ToBoolean(FindKey(opts, "UseUTF16Encoding", "False"), CultureInfo.InvariantCulture) == true);
   571         -        SQLiteDateFormats dateFormat = String.Compare(FindKey(opts, "DateTimeFormat", "ISO8601"), "ticks", true, CultureInfo.CurrentCulture) == 0 ? SQLiteDateFormats.Ticks : SQLiteDateFormats.ISO8601;
          571  +        SQLiteDateFormats dateFormat = String.Compare(FindKey(opts, "DateTimeFormat", "ISO8601"), "ticks", true, CultureInfo.InvariantCulture) == 0 ? SQLiteDateFormats.Ticks : SQLiteDateFormats.ISO8601;
   572    572   
   573    573           if (bUTF16) // SQLite automatically sets the encoding of the database to UTF16 if called from sqlite3_open16()
   574    574             _sql = new SQLite3_UTF16(dateFormat);
   575    575           else
   576    576             _sql = new SQLite3(dateFormat);
   577    577   
   578    578             _sql.Open(strFile);
   579    579   
   580    580           _dataSource = System.IO.Path.GetFileNameWithoutExtension(strFile);
   581    581   
   582    582           _sql.Execute(String.Format(CultureInfo.InvariantCulture, "PRAGMA Synchronous={0}", FindKey(opts, "Synchronous", "Normal")));
   583    583           _sql.Execute(String.Format(CultureInfo.InvariantCulture, "PRAGMA Cache_Size={0}", FindKey(opts, "Cache Size", "2000")));
   584         -        if (String.Compare(":MEMORY:", strFile, true, CultureInfo.CurrentCulture) == 0)
          584  +        if (String.Compare(":MEMORY:", strFile, true, CultureInfo.InvariantCulture) == 0)
   585    585             _sql.Execute(String.Format(CultureInfo.InvariantCulture, "PRAGMA Page_Size={0}", FindKey(opts, "Page Size", "1024")));
   586    586         }
   587    587         catch (SQLiteException)
   588    588         {
   589    589           OnStateChange(ConnectionState.Broken);
   590    590           throw;
   591    591         }
................................................................................
   674    674           throw new InvalidOperationException();
   675    675   
   676    676         string[] parms = new string[5];
   677    677   
   678    678         restrictionValues.CopyTo(parms, 0);
   679    679   
   680    680         if (restrictionValues == null) restrictionValues = new string[0];
   681         -      switch (collectionName.ToUpper(CultureInfo.CurrentCulture))
          681  +      switch (collectionName.ToUpper(CultureInfo.InvariantCulture))
   682    682         {
   683    683           case "METADATACOLLECTIONS":
   684    684             return Schema_MetaDataCollections();
   685    685           case "DATASOURCEINFORMATION":
   686    686             return Schema_DataSourceInformation();
   687    687           //case "RESERVEDWORDS":
   688    688           //  return Schema_ReservedWords();
................................................................................
   879    879         tbl.Columns.Add("DOMAIN_NAME", typeof(string));
   880    880         tbl.Columns.Add("DESCRIPTION", typeof(string));
   881    881   
   882    882         tbl.BeginLoadData();
   883    883   
   884    884         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
   885    885   
   886         -      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table' OR [type] LIKE 'view'", strCatalog), this))
          886  +      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table' OR [type] LIKE 'view'", strCatalog), this))
   887    887         {
   888    888           using (SQLiteDataReader rdTables = cmdTables.ExecuteReader())
   889    889           {
   890    890             while (rdTables.Read())
   891    891             {
   892         -            if (String.IsNullOrEmpty(strTable) || String.Compare(strTable, rdTables.GetString(2), true, CultureInfo.CurrentCulture) == 0)
          892  +            if (String.IsNullOrEmpty(strTable) || String.Compare(strTable, rdTables.GetString(2), true, CultureInfo.InvariantCulture) == 0)
   893    893               {
   894         -              using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[{1}]", strCatalog, rdTables.GetString(2)), this))
          894  +              using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}]", strCatalog, rdTables.GetString(2)), this))
   895    895                 {
   896    896                   using (SQLiteDataReader rd = (SQLiteDataReader)cmd.ExecuteReader(CommandBehavior.SchemaOnly))
   897    897                   {
   898    898                     using (DataTable tblSchema = rd.GetSchemaTable())
   899    899                     {
   900    900                       foreach (DataRow schemaRow in tblSchema.Rows)
   901    901                       {
   902         -                      if (String.Compare(schemaRow[SchemaTableColumn.ColumnName].ToString(), strColumn, true, CultureInfo.CurrentCulture) == 0
          902  +                      if (String.Compare(schemaRow[SchemaTableColumn.ColumnName].ToString(), strColumn, true, CultureInfo.InvariantCulture) == 0
   903    903                           || strColumn == null)
   904    904                         {
   905    905                           row = tbl.NewRow();
   906    906   
   907    907                           row["TABLE_NAME"] = rdTables.GetString(2);
   908    908                           row["COLUMN_NAME"] = schemaRow[SchemaTableColumn.ColumnName];
   909    909                           row["TABLE_CATALOG"] = strCatalog;
................................................................................
   972    972         tbl.Columns.Add("FILTER_CONDITION", typeof(string));
   973    973         tbl.Columns.Add("INTEGRATED", typeof(bool));
   974    974   
   975    975         tbl.BeginLoadData();
   976    976   
   977    977         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
   978    978   
   979         -      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table'", strCatalog), this))
          979  +      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table'", strCatalog), this))
   980    980         {
   981    981           using (SQLiteDataReader rdTables = cmdTables.ExecuteReader())
   982    982           {
   983    983             while (rdTables.Read())
   984    984             {
   985         -            if (String.IsNullOrEmpty(strTable) || String.Compare(rdTables.GetString(2), strTable, true, CultureInfo.CurrentCulture) == 0)
          985  +            if (String.IsNullOrEmpty(strTable) || String.Compare(rdTables.GetString(2), strTable, true, CultureInfo.InvariantCulture) == 0)
   986    986               {
   987         -              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}]", rdTables.GetString(2)), this))
          987  +              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}]", rdTables.GetString(2)), this))
   988    988                 {
   989    989                   using (SQLiteDataReader rdTable = cmdTable.ExecuteReader(CommandBehavior.SchemaOnly))
   990    990                   {
   991    991                     tblSchema = rdTable.GetSchemaTable();
   992    992                     foreach (DataRow schemaRow in tblSchema.Rows)
   993    993                     {
   994    994                       if (Convert.ToBoolean(schemaRow[SchemaTableColumn.IsKey], CultureInfo.CurrentCulture) == true)
   995    995                       {
   996    996                         row = tbl.NewRow();
   997    997                         row["TABLE_CATALOG"] = strCatalog;
   998    998                         row["TABLE_NAME"] = rdTables.GetString(2);
   999    999                         row["INDEX_CATALOG"] = strCatalog;
  1000         -                      row["INDEX_NAME"] = String.Format(CultureInfo.CurrentCulture, "PK_{0}_{1}", rdTables.GetString(2), schemaRow[SchemaTableColumn.BaseColumnName]);
         1000  +                      row["INDEX_NAME"] = String.Format(CultureInfo.InvariantCulture, "PK_{0}_{1}", rdTables.GetString(2), schemaRow[SchemaTableColumn.BaseColumnName]);
  1001   1001                         row["PRIMARY_KEY"] = true;
  1002   1002                         row["UNIQUE"] = true;
  1003         -                      if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, row["INDEX_NAME"].ToString(), true, CultureInfo.CurrentCulture) == 0)
         1003  +                      if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, row["INDEX_NAME"].ToString(), true, CultureInfo.InvariantCulture) == 0)
  1004   1004                         {
  1005   1005                           tbl.Rows.Add(row);
  1006   1006                         }
  1007   1007                       }
  1008   1008                     }
  1009   1009                   }
  1010   1010                 }
  1011         -              using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "PRAGMA [{0}].index_list([{1}])", strCatalog, rdTables.GetString(2)), this))
         1011  +              using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].index_list([{1}])", strCatalog, rdTables.GetString(2)), this))
  1012   1012                 {
  1013   1013                   using (SQLiteDataReader rd = (SQLiteDataReader)cmd.ExecuteReader())
  1014   1014                   {
  1015   1015                     while (rd.Read())
  1016   1016                     {
  1017         -                    if (String.Compare(rd.GetString(1), strIndex, true, CultureInfo.CurrentCulture) == 0
         1017  +                    if (String.Compare(rd.GetString(1), strIndex, true, CultureInfo.InvariantCulture) == 0
  1018   1018                       || strIndex == null)
  1019   1019                       {
  1020   1020                         row = tbl.NewRow();
  1021   1021   
  1022   1022                         row["TABLE_CATALOG"] = strCatalog;
  1023   1023                         row["TABLE_NAME"] = rdTables.GetString(2);
  1024   1024                         row["INDEX_CATALOG"] = strCatalog;
................................................................................
  1060   1060         tbl.Columns.Add("TABLE_NAME", typeof(string));
  1061   1061         tbl.Columns.Add("TABLE_TYPE", typeof(string));
  1062   1062   
  1063   1063         tbl.BeginLoadData();
  1064   1064   
  1065   1065         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
  1066   1066   
  1067         -      using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] NOT LIKE 'index'", strCatalog), this))
         1067  +      using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] NOT LIKE 'index'", strCatalog), this))
  1068   1068         {
  1069   1069           using (SQLiteDataReader rd = (SQLiteDataReader)cmd.ExecuteReader())
  1070   1070           {
  1071   1071             while (rd.Read())
  1072   1072             {
  1073   1073               strItem = rd.GetString(0);
  1074         -            if (String.Compare(rd.GetString(2), 0, "SQLITE_", 0, 7, true, CultureInfo.CurrentCulture) == 0)
         1074  +            if (String.Compare(rd.GetString(2), 0, "SQLITE_", 0, 7, true, CultureInfo.InvariantCulture) == 0)
  1075   1075                 strItem = "SYSTEM_TABLE";
  1076   1076   
  1077         -            if (String.Compare(strType, strItem, true, CultureInfo.CurrentCulture) == 0
         1077  +            if (String.Compare(strType, strItem, true, CultureInfo.InvariantCulture) == 0
  1078   1078                 || strType == null)
  1079   1079               {
  1080         -              if (String.Compare(rd.GetString(2), strTable, true, CultureInfo.CurrentCulture) == 0
         1080  +              if (String.Compare(rd.GetString(2), strTable, true, CultureInfo.InvariantCulture) == 0
  1081   1081                   || strTable == null)
  1082   1082                 {
  1083   1083                   row = tbl.NewRow();
  1084   1084   
  1085   1085                   row["TABLE_CATALOG"] = strCatalog;
  1086   1086                   row["TABLE_NAME"] = rd.GetString(2);
  1087   1087                   row["TABLE_TYPE"] = strItem;
................................................................................
  1123   1123         tbl.Columns.Add("DATE_CREATED", typeof(DateTime));
  1124   1124         tbl.Columns.Add("DATE_MODIFIED", typeof(DateTime));
  1125   1125   
  1126   1126         tbl.BeginLoadData();
  1127   1127   
  1128   1128         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
  1129   1129   
  1130         -      using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'view'", strCatalog), this))
         1130  +      using (SQLiteCommand cmd = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'view'", strCatalog), this))
  1131   1131         {
  1132   1132           using (SQLiteDataReader rd = (SQLiteDataReader)cmd.ExecuteReader())
  1133   1133           {
  1134   1134             while (rd.Read())
  1135   1135             {
  1136         -            if (String.Compare(rd.GetString(1), strView, true, CultureInfo.CurrentCulture) == 0
         1136  +            if (String.Compare(rd.GetString(1), strView, true, CultureInfo.InvariantCulture) == 0
  1137   1137                 || String.IsNullOrEmpty(strView))
  1138   1138               {
  1139   1139                 strItem = rd.GetString(4);
  1140   1140                 nPos = Globalization.CultureInfo.InvariantCulture.CompareInfo.IndexOf(strItem, " AS ", CompareOptions.IgnoreCase);
  1141   1141                 if (nPos > -1)
  1142   1142                 {
  1143   1143                   strItem = strItem.Substring(nPos + 4).Trim();
................................................................................
  1179   1179   
  1180   1180         using (SQLiteCommand cmd = new SQLiteCommand("PRAGMA database_list", this))
  1181   1181         {
  1182   1182           using (SQLiteDataReader rd = (SQLiteDataReader)cmd.ExecuteReader())
  1183   1183           {
  1184   1184             while (rd.Read())
  1185   1185             {
  1186         -            if (String.Compare(rd.GetString(1), strCatalog, true, CultureInfo.CurrentCulture) == 0
         1186  +            if (String.Compare(rd.GetString(1), strCatalog, true, CultureInfo.InvariantCulture) == 0
  1187   1187                 || strCatalog == null)
  1188   1188               {
  1189   1189                 row = tbl.NewRow();
  1190   1190   
  1191   1191                 row["CATALOG_NAME"] = rd.GetString(1);
  1192   1192   
  1193   1193                 tbl.Rows.Add(row);
................................................................................
  1480   1480         tbl.Columns.Add("ORDINAL_POSITION", typeof(int));
  1481   1481         tbl.Columns.Add("INDEX_NAME", typeof(string));
  1482   1482   
  1483   1483         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
  1484   1484   
  1485   1485         tbl.BeginLoadData();
  1486   1486   
  1487         -      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table'", strCatalog), this))
         1487  +      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table'", strCatalog), this))
  1488   1488         {
  1489   1489           using (SQLiteDataReader rdTables = cmdTables.ExecuteReader())
  1490   1490           {
  1491   1491             while (rdTables.Read())
  1492   1492             {
  1493         -            if (String.IsNullOrEmpty(strTable) || String.Compare(rdTables.GetString(2), strTable, true, CultureInfo.CurrentCulture) == 0)
         1493  +            if (String.IsNullOrEmpty(strTable) || String.Compare(rdTables.GetString(2), strTable, true, CultureInfo.InvariantCulture) == 0)
  1494   1494               {
  1495         -              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}]", rdTables.GetString(2)), this))
         1495  +              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}]", rdTables.GetString(2)), this))
  1496   1496                 {
  1497   1497                   using (SQLiteDataReader rdTable = cmdTable.ExecuteReader(CommandBehavior.SchemaOnly))
  1498   1498                   {
  1499   1499                     tblSchema = rdTable.GetSchemaTable();
  1500   1500                     foreach (DataRow schemaRow in tblSchema.Rows)
  1501   1501                     {
  1502         -                    if (Convert.ToBoolean(schemaRow[SchemaTableColumn.IsKey], CultureInfo.CurrentCulture) == true)
         1502  +                    if (Convert.ToBoolean(schemaRow[SchemaTableColumn.IsKey], CultureInfo.InvariantCulture) == true)
  1503   1503                       {
  1504   1504                         row = tbl.NewRow();
  1505   1505                         row["CONSTRAINT_CATALOG"] = strCatalog;
  1506         -                      row["CONSTRAINT_NAME"] = String.Format(CultureInfo.CurrentCulture, "PK_{0}_{1}", rdTables.GetString(2), schemaRow[SchemaTableColumn.BaseColumnName]);
         1506  +                      row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "PK_{0}_{1}", rdTables.GetString(2), schemaRow[SchemaTableColumn.BaseColumnName]);
  1507   1507                         row["TABLE_CATALOG"] = strCatalog;
  1508   1508                         row["TABLE_NAME"] = rdTables.GetString(2);
  1509   1509                         row["COLUMN_NAME"] = schemaRow[SchemaTableColumn.BaseColumnName];
  1510   1510                         row["INDEX_NAME"] = row["CONSTRAINT_NAME"];
  1511   1511                         row["ORDINAL_POSITION"] = schemaRow[SchemaTableColumn.ColumnOrdinal];
  1512         -                      if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, row["INDEX_NAME"].ToString(), true, CultureInfo.CurrentCulture) == 0)
         1512  +                      if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, row["INDEX_NAME"].ToString(), true, CultureInfo.InvariantCulture) == 0)
  1513   1513                         {
  1514   1514                           tbl.Rows.Add(row);
  1515   1515                         }
  1516   1516                       }
  1517   1517                     }
  1518   1518                   }
  1519   1519                 }
  1520         -              using (SQLiteCommand cmdIndexes = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'index' AND [tbl_name] LIKE '{1}'", strCatalog, rdTables.GetString(2)), this))
         1520  +              using (SQLiteCommand cmdIndexes = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'index' AND [tbl_name] LIKE '{1}'", strCatalog, rdTables.GetString(2)), this))
  1521   1521                 {
  1522   1522                   using (SQLiteDataReader rdIndexes = cmdIndexes.ExecuteReader())
  1523   1523                   {
  1524   1524                     while (rdIndexes.Read())
  1525   1525                     {
  1526         -                    if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, rdIndexes.GetString(1), true, CultureInfo.CurrentCulture) == 0)
         1526  +                    if (String.IsNullOrEmpty(strIndex) || String.Compare(strIndex, rdIndexes.GetString(1), true, CultureInfo.InvariantCulture) == 0)
  1527   1527                       {
  1528         -                      using (SQLiteCommand cmdIndex = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "PRAGMA [{0}].index_info([{1}])", strCatalog, rdIndexes.GetString(1)), this))
         1528  +                      using (SQLiteCommand cmdIndex = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].index_info([{1}])", strCatalog, rdIndexes.GetString(1)), this))
  1529   1529                         {
  1530   1530                           using (SQLiteDataReader rdIndex = cmdIndex.ExecuteReader())
  1531   1531                           {
  1532   1532                             while (rdIndex.Read())
  1533   1533                             {
  1534   1534                               row = tbl.NewRow();
  1535   1535                               row["CONSTRAINT_CATALOG"] = strCatalog;
................................................................................
  1586   1586         tbl.Columns.Add("TABLE_NAME", typeof(string));
  1587   1587         tbl.Columns.Add("COLUMN_NAME", typeof(string));
  1588   1588   
  1589   1589         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
  1590   1590   
  1591   1591         tbl.BeginLoadData();
  1592   1592   
  1593         -      using (SQLiteCommand cmdViews = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'view'", strCatalog), this))
         1593  +      using (SQLiteCommand cmdViews = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'view'", strCatalog), this))
  1594   1594         {
  1595   1595           using (SQLiteDataReader rdViews = cmdViews.ExecuteReader())
  1596   1596           {
  1597   1597             while (rdViews.Read())
  1598   1598             {
  1599         -            if (String.IsNullOrEmpty(strView) || String.Compare(strView, rdViews.GetString(2), true, CultureInfo.CurrentCulture) == 0)
         1599  +            if (String.IsNullOrEmpty(strView) || String.Compare(strView, rdViews.GetString(2), true, CultureInfo.InvariantCulture) == 0)
  1600   1600               {
  1601         -              using (SQLiteCommand cmdViewSelect = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[{1}]", strCatalog, rdViews.GetString(2)), this))
         1601  +              using (SQLiteCommand cmdViewSelect = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[{1}]", strCatalog, rdViews.GetString(2)), this))
  1602   1602                 {
  1603   1603                   strSql = rdViews.GetString(4);
  1604         -                n = CultureInfo.CurrentCulture.CompareInfo.IndexOf(strSql, " AS ", CompareOptions.IgnoreCase);
         1604  +                n = CultureInfo.InvariantCulture.CompareInfo.IndexOf(strSql, " AS ", CompareOptions.IgnoreCase);
  1605   1605                   if (n < 0)
  1606   1606                     continue;
  1607   1607   
  1608   1608                   strSql = strSql.Substring(n + 4);
  1609   1609   
  1610   1610                   using (SQLiteCommand cmd = new SQLiteCommand(strSql, this))
  1611   1611                   {
................................................................................
  1618   1618                           using (DataTable tblSchema = rd.GetSchemaTable())
  1619   1619                           {
  1620   1620                             for (n = 0; n < tblSchema.Rows.Count; n++)
  1621   1621                             {
  1622   1622                               viewRow = tblSchemaView.Rows[n];
  1623   1623                               schemaRow = tblSchema.Rows[n];
  1624   1624   
  1625         -                            if (String.Compare(viewRow[SchemaTableColumn.ColumnName].ToString(), strColumn, true, CultureInfo.CurrentCulture) == 0
         1625  +                            if (String.Compare(viewRow[SchemaTableColumn.ColumnName].ToString(), strColumn, true, CultureInfo.InvariantCulture) == 0
  1626   1626                                 || strColumn == null)
  1627   1627                               {
  1628   1628                                 row = tbl.NewRow();
  1629   1629   
  1630   1630                                 row["VIEW_CATALOG"] = strCatalog;
  1631   1631                                 row["VIEW_NAME"] = rdViews.GetString(2);
  1632   1632                                 row["TABLE_CATALOG"] = strCatalog;
................................................................................
  1684   1684         tbl.Columns.Add("FKEY_TO_TABLE", typeof(string));
  1685   1685         tbl.Columns.Add("FKEY_TO_COLUMN", typeof(string));
  1686   1686   
  1687   1687         if (String.IsNullOrEmpty(strCatalog)) strCatalog = "main";
  1688   1688   
  1689   1689         tbl.BeginLoadData();
  1690   1690   
  1691         -      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table'", strCatalog), this))
         1691  +      using (SQLiteCommand cmdTables = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}].[sqlite_master] WHERE [type] LIKE 'table'", strCatalog), this))
  1692   1692         {
  1693   1693           using (SQLiteDataReader rdTables = cmdTables.ExecuteReader())
  1694   1694           {
  1695   1695             while (rdTables.Read())
  1696   1696             {
  1697         -            if (String.IsNullOrEmpty(strTable) || String.Compare(strTable, rdTables.GetString(2), true, CultureInfo.CurrentCulture) == 0)
         1697  +            if (String.IsNullOrEmpty(strTable) || String.Compare(strTable, rdTables.GetString(2), true, CultureInfo.InvariantCulture) == 0)
  1698   1698               {
  1699         -              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "SELECT * FROM [{0}]", rdTables.GetString(2)), this))
         1699  +              using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "SELECT * FROM [{0}]", rdTables.GetString(2)), this))
  1700   1700                 {
  1701   1701                   using (SQLiteDataReader rdTable = cmdTable.ExecuteReader(CommandBehavior.SchemaOnly))
  1702   1702                   {
  1703         -                  using (SQLiteCommand cmdKey = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "PRAGMA [{0}].foreign_key_list([{1}])", strCatalog, rdTables.GetString(2)), this))
         1703  +                  using (SQLiteCommand cmdKey = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{0}].foreign_key_list([{1}])", strCatalog, rdTables.GetString(2)), this))
  1704   1704                     {
  1705   1705                       using (SQLiteDataReader rdKey = cmdKey.ExecuteReader())
  1706   1706                       {
  1707   1707                         while (rdKey.Read())
  1708   1708                         {
  1709   1709                           row = tbl.NewRow();
  1710   1710                           row["CONSTRAINT_CATALOG"] = strCatalog;
  1711         -                        row["CONSTRAINT_NAME"] = String.Format(CultureInfo.CurrentCulture, "FK_{0}_{1}_{2}", rdTables.GetString(2), rdKey.GetString(3), rdKey.GetString(4));
         1711  +                        row["CONSTRAINT_NAME"] = String.Format(CultureInfo.InvariantCulture, "FK_{0}_{1}_{2}", rdTables.GetString(2), rdKey.GetString(3), rdKey.GetString(4));
  1712   1712                           row["TABLE_CATALOG"] = strCatalog;
  1713   1713                           row["TABLE_NAME"] = rdTables.GetString(2);
  1714   1714                           row["CONSTRAINT_TYPE"] = "FOREIGN KEY";
  1715   1715                           row["IS_DEFERRABLE"] = false;
  1716   1716                           row["INITIALLY_DEFERRED"] = false;
  1717   1717                           row["FKEY_FROM_COLUMN"] = rdKey.GetString(3);
  1718   1718                           row["FKEY_FROM_ORDINAL_POSITION"] = rdTable.GetOrdinal(row["FKEY_FROM_COLUMN"].ToString());
  1719   1719                           row["FKEY_TO_CATALOG"] = strCatalog;
  1720   1720                           row["FKEY_TO_TABLE"] = rdKey.GetString(2);
  1721   1721                           row["FKEY_TO_COLUMN"] = rdKey.GetString(4);
  1722   1722   
  1723         -                        if (String.IsNullOrEmpty(strKeyName) || String.Compare(strKeyName, row["CONSTRAINT_NAME"].ToString(), true, CultureInfo.CurrentCulture) == 0)
         1723  +                        if (String.IsNullOrEmpty(strKeyName) || String.Compare(strKeyName, row["CONSTRAINT_NAME"].ToString(), true, CultureInfo.InvariantCulture) == 0)
  1724   1724                             tbl.Rows.Add(row);
  1725   1725                         }
  1726   1726                       }
  1727   1727                     }
  1728   1728                   }
  1729   1729                 }
  1730   1730               }

Changes to System.Data.SQLite/SQLiteConvert.cs.

   483    483       internal static DbType TypeNameToDbType(string Name)
   484    484       {
   485    485         if (String.IsNullOrEmpty(Name)) return DbType.Object;
   486    486   
   487    487         int x = _typeNames.Length;
   488    488         for (int n = 0; n < x; n++)
   489    489         {
   490         -        if (String.Compare(Name, 0, _typeNames[n].typeName, 0, _typeNames[n].typeName.Length, true, CultureInfo.CurrentCulture) == 0)
          490  +        if (String.Compare(Name, 0, _typeNames[n].typeName, 0, _typeNames[n].typeName.Length, true, CultureInfo.InvariantCulture) == 0)
   491    491             return _typeNames[n].dataType; 
   492    492         }
   493    493         return DbType.Object;
   494    494       }
   495    495       #endregion
   496    496   
   497    497       private static SQLiteTypeNames[] _typeNames = {

Changes to System.Data.SQLite/SQLiteDataReader.cs.

   508    508   
   509    509                 if (arName.Length > 2)
   510    510                   strCatalog = arName[arName.Length - 3];
   511    511   
   512    512                 // If we have a table-bound column, extract the extra information from it
   513    513                 if (arName.Length > 1)
   514    514                 {
   515         -                using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.CurrentCulture, "PRAGMA [{1}].TABLE_INFO([{0}])", strTable, strCatalog), cnn))
          515  +                using (SQLiteCommand cmdTable = new SQLiteCommand(String.Format(CultureInfo.InvariantCulture, "PRAGMA [{1}].TABLE_INFO([{0}])", strTable, strCatalog), cnn))
   516    516                   {
   517    517                     if (arName.Length < 3) strCatalog = "main";
   518    518   
   519    519                     using (DbDataReader rdTable = cmdTable.ExecuteReader())
   520    520                     {
   521    521                       while (rdTable.Read())
   522    522                       {
   523         -                      if (String.Compare(arName[arName.Length - 1], rdTable.GetString(1), true, CultureInfo.CurrentCulture) == 0)
          523  +                      if (String.Compare(arName[arName.Length - 1], rdTable.GetString(1), true, CultureInfo.InvariantCulture) == 0)
   524    524                         {
   525    525                           string strType = rdTable.GetString(2);
   526    526                           string[] arSize = strType.Split('(');
   527    527                           if (arSize.Length > 1)
   528    528                           {
   529    529                             strType = arSize[0];
   530    530                             arSize = arSize[1].Split(')');

Changes to System.Data.SQLite/SQLiteParameterCollection.cs.

   278    278       /// <param name="parameterName">The name of the parameter to find</param>
   279    279       /// <returns>-1 if not found, otherwise a zero-based index of the parameter</returns>
   280    280       public override int IndexOf(string parameterName)
   281    281       {
   282    282         int x = _parameterList.Count;
   283    283         for (int n = 0; n < x; n++)
   284    284         {
   285         -        if (String.Compare(parameterName, _parameterList[n].ParameterName, true, CultureInfo.CurrentCulture) == 0)
          285  +        if (String.Compare(parameterName, _parameterList[n].ParameterName, true, CultureInfo.InvariantCulture) == 0)
   286    286             return n;
   287    287         }
   288    288         return -1;
   289    289       }
   290    290   
   291    291       /// <summary>
   292    292       /// Returns the index of a parameter

Changes to System.Data.SQLite/SQLiteStatement.cs.

    92     92       internal bool MapParameter(string s, SQLiteParameter p)
    93     93       {
    94     94         if (_paramNames == null) return false;
    95     95   
    96     96         int x = _paramNames.Length;
    97     97         for (int n = 0; n < x; n++)
    98     98         {
    99         -        if (String.Compare(_paramNames[n], s, true, CultureInfo.CurrentCulture) == 0)
           99  +        if (String.Compare(_paramNames[n], s, true, CultureInfo.InvariantCulture) == 0)
   100    100           {
   101    101             _paramValues[n] = p;
   102    102             return true;
   103    103           }
   104    104         }
   105    105         return false;
   106    106       }