bind parameters in SqlCommand...

for sql server 2005 (tested)

 

use batch insert with binding parameters like following:

 

 comm.Parameters.Add("@val", System.Data.SqlDbType.Binary, temp.Length).Value = temp;
 comm.ExecuteNonQuery();

 

don't forget

 

comm.Parameters.Clear();

 

otherwise an exception will be raised..

 

 

for sqlite with System.Data.Sqlite

 

comm.Parameters.Clear() is optional...

 

 

你可能感兴趣的:(sql,SQL Server,sqlite)