System.Data.SQLite
Check-in [58a81d6326]
Not logged in

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

Overview
Comment:BinaryInsert test modified to use ampersand parameters
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | sourceforge
Files: files | file ages | folders
SHA1: 58a81d6326bc6f40b1581ade673e1698b3d0d1a9
User & Date: rmsimpson 2005-11-21 16:30:33
Context
2005-11-22
14:53
no message check-in: bd09265a2c user: rmsimpson tags: sourceforge
2005-11-21
16:30
BinaryInsert test modified to use ampersand parameters check-in: 58a81d6326 user: rmsimpson tags: sourceforge
16:30
Added more ISO8601 datetimes check-in: c16bb7e835 user: rmsimpson tags: sourceforge
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/TestCases.cs.

   238    238           cmd.Parameters.Add(Field4);
   239    239           cmd.Parameters.Add(Field5);
   240    240   
   241    241           cmd.ExecuteNonQuery();
   242    242         }
   243    243       }
   244    244   
          245  +    // Inserts binary data into the database using a named parameter
   245    246       internal static void BinaryInsert(DbConnection cnn)
   246    247       {
   247    248         using (DbCommand cmd = cnn.CreateCommand())
   248    249         {
   249         -        cmd.CommandText = "INSERT INTO TestCase(Field6) VALUES($bin)";
          250  +        cmd.CommandText = "INSERT INTO TestCase(Field6) VALUES(@bin)";
   250    251           DbParameter Field6 = cmd.CreateParameter();
   251    252   
   252    253           byte[] b = new byte[4000];
   253    254           b[0] = 1;
   254    255           b[100] = 2;
   255    256           b[1000] = 3;
   256    257           b[2000] = 4;
   257    258           b[3000] = 5;
   258    259   
   259         -        Field6.ParameterName = "$bin";
          260  +        Field6.ParameterName = "@bin";
   260    261           Field6.Value = b;
   261    262   
   262    263           cmd.Parameters.Add(Field6);
   263    264   
   264    265           cmd.ExecuteNonQuery();
   265    266         }
   266    267       }