<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://sqlite.phxsoftware.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How To</title><link>http://sqlite.phxsoftware.com/forums/10.aspx</link><description>Sample code and instructions for working with SQLite.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Help with a MSSQL Convert</title><link>http://sqlite.phxsoftware.com/forums/thread/9846.aspx</link><pubDate>Thu, 02 Sep 2010 21:22:57 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9846</guid><dc:creator>tknman0700</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9846.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9846</wfw:commentRss><description>&lt;p&gt;I am trying to convert my MS SQL knowledge into SQLite and having a bit of a problem... my biggest concern here is lack of variable and stored procedure support so I am trying to understand how to make this all work.&lt;/p&gt;&lt;p&gt;&amp;nbsp;When I do this...&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; Dim sql As String = &amp;quot;insert into tblRecords2(CRC) values (&amp;#39;866A463AF32A4BF102E532AAD9E621&amp;#39;);insert into tblDataRecords(dataID,chunkID,chunkSequence) values (1, last_insert_rowid(),1)&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim slc As New SQLite.SQLiteConnection(&amp;quot;data source=C:\Users\m001kah\Desktop\Services.db&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim slcmd As New SQLite.SQLiteCommand(slc)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim slda As New SQLite.SQLiteDataAdapter()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slda.SelectCommand = slcmd&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; slda.Fill(dt)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If Not IsNothing(dt) Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If dt.Rows.Count &amp;gt; 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chunkID = dt.Rows(0).Item(0)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/p&gt;&lt;p&gt;I get an exception:&amp;nbsp; Value cannot be null. Parameter name: s&lt;/p&gt;&lt;p&gt;First off I dont know that this means... help please.&lt;/p&gt;&lt;p&gt;Secondly I have been testing the SQL statement in SQLRazor and I see that the last_insert_rowid() is 0 but the insert into tblRecords2 actually worked.... arghh.. please advise.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks &lt;br /&gt;&lt;/p&gt;</description></item><item><title>How to use CHAR's ?</title><link>http://sqlite.phxsoftware.com/forums/thread/9826.aspx</link><pubDate>Tue, 31 Aug 2010 15:22:47 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9826</guid><dc:creator>Marc</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9826.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9826</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I created a table with a CHAR column in it, like this:&lt;/p&gt;
&lt;p&gt;CREATE TABLE ClientData(....,&amp;nbsp;Status &lt;strong&gt;CHAR(1)&lt;/strong&gt; NULL, ...)&lt;/p&gt;
&lt;p&gt;When inserting data i use a parameter with DbType.Byte.&lt;/p&gt;
&lt;p&gt;But when I read the data using a DataReader (SQLiteDataReader) and try the following code&lt;/p&gt;
&lt;p&gt;char x = dataReader.GetChar(10);&lt;/p&gt;
&lt;p&gt;i get:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Specified cast is not valid.&lt;br /&gt;&lt;/strong&gt;at System.Data.SQLite.SQLiteDataReader.VerifyType(Int32 i, DbType typ)&lt;br /&gt;at System.Data.SQLite.SQLiteDataReader.GetChar(Int32 i)&lt;/p&gt;
&lt;p&gt;I tried debugging this and I see that in the reader&amp;nbsp;the column has an SQLiteType with Type=String and Affinity=Null and it is the Affinity=Null that is causing the exception.&lt;/p&gt;
&lt;p&gt;Can you tell me where i went wrong ?&lt;/p&gt;
&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item><item><title>Question about using 32-bit and 64-bit libraries</title><link>http://sqlite.phxsoftware.com/forums/thread/8860.aspx</link><pubDate>Wed, 27 Jan 2010 05:11:04 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:8860</guid><dc:creator>aravenwood</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/8860.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=8860</wfw:commentRss><description>Hi - I&amp;#39;ve read several of the posts in the forum about using 32-bit/64-bit versions of sqlite.net but I am still in the dark about whether certain things are possible or how to go about doing this properly.  Here is my issue:

I have a vb.net windows forms app using .net framework 2.0 via VS2008.  This application uses sqlite.net to access sql databases.  I am in the process of creating my setup/installer for the application, and will use the installer creation capability in VS2008.  For reference my app was originally a vb6 app that I upgraded, and added the capability to access sqlite.

To reach the broadest audience possible, I would like for my app to run on both 32-bit and 64-bit Windows platforms.  To keep things as *simple* as possible to maintain, I would like to have only one setup/installer which will install an application that will run on either 32-bit or 64-bit Windows.  To do this I set my compile settings to &amp;quot;any cpu&amp;quot;.

My understanding from reading the forums here is that sqlite has both 32-bit and 64-bit versions, but there is not  a single  version that runs on both primarily because sqlite (which is include in the sqlite.net assembly) does not have a binary that will work on both 32-bit and 64-bit.

1)  Is this understanding correct?  And is the implication that I must have two separate versions of my - one for 64-bit which includes the 64-bit version of sqlite.net and one for 32-bit which includes 320bit sqlite.net?  If this is not true, how do I get, and use the assembly that runs on both types of OS&amp;#39;es?

2)  If I need to have the 32-bit assembly for 32-bit systems and the 64-bit assembly for 64-bit systems, is there any way to include *both* the 32-bit and the 64-bit versions of sqlite.net in my application and how do I set things up so that it would autosense which is the correct assembly to use depending on type (32-bit/64-bit) of the OS?

Apologies if my post is not clear or if this already answered in another post, but I am a bit of Noob with .net and do not understand it completely yet.  Any help, comments, suggestions, examples or links that could help with this issue is appreciated.

Thanks in advance,
Michael</description></item><item><title>Invalid database Path</title><link>http://sqlite.phxsoftware.com/forums/thread/9785.aspx</link><pubDate>Thu, 19 Aug 2010 11:01:15 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9785</guid><dc:creator>kumander</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9785.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9785</wfw:commentRss><description>&lt;p&gt;hello to all &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i have a problem on connecting to database coz its always says invalid path i&amp;#39;m using windows mobile 5.0 .net 2005 my code is vb, i&amp;#39;m running in my local pc emulator what should i do to connect to database what correct connection string or where should i put my database..please help&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks &lt;/p&gt;</description></item><item><title>What is the query to check if an attribute in a table existed or not?</title><link>http://sqlite.phxsoftware.com/forums/thread/9754.aspx</link><pubDate>Tue, 10 Aug 2010 08:30:25 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9754</guid><dc:creator>xhnguyen</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9754.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9754</wfw:commentRss><description>Hi,

The question is in the title is clear, I guess.

What/how is the query to check if an attribute in a table existed or not?

I am doing with SQLite.

Thanks in advance.</description></item><item><title>How I get DatabaseObjects and DatabaseObjectsProperties</title><link>http://sqlite.phxsoftware.com/forums/thread/9744.aspx</link><pubDate>Thu, 05 Aug 2010 16:00:59 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9744</guid><dc:creator>edgarchiroleo</dc:creator><slash:comments>3</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9744.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9744</wfw:commentRss><description>&lt;p&gt;Hi, i&amp;#39;m writing an application in C# and need to know how to get 
DatabaseObjects and DatabaseObjectsProperties of my database in SQLite. For example, in SQL2005 obtain DatabaseObjects is in this way:&lt;/p&gt;&lt;p&gt;SET NOEXEC OFF&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select name, xtype, id&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from [{0}].dbo.sysobjects&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; where name like (&amp;#39;{1}%&amp;#39;) and xtype in (&amp;#39;U&amp;#39;,&amp;#39;V&amp;#39;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; order by xtype, name&lt;/p&gt;&lt;p&gt;How a can do this for SQLite&lt;/p&gt;&lt;p&gt;Thanks.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>How do I fetch the schema of the tables &amp; associated metadata?</title><link>http://sqlite.phxsoftware.com/forums/thread/1185.aspx</link><pubDate>Sun, 30 Apr 2006 14:53:52 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:1185</guid><dc:creator>Sourjya Sankar Sen</dc:creator><slash:comments>7</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/1185.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=1185</wfw:commentRss><description>&amp;nbsp;&amp;nbsp;&amp;nbsp; Hi,&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I'm totally new to SQLite and am just a little familiar with the ADODB classes. I'm trying to design a simple database and table creation tool using C# on .NET 2.0. So far I've been able to create databases and tables using the ADO.NET wrapper found here. But where I'm failing is to read the table metadata back and displaying it on screen. I can't figure out the exact code to do this. Now my code works kind of one-way :D i.e., you can create tables - but cannot see the columns/indices and other associated metadata. Can anyone provide me with a code sample as to how to do this?&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; What I did try though - was to pass a "DESCRIBE &lt;i&gt;tablename&lt;/i&gt;" statement through the ADO.NET Provider to SQLite, hoping it would return the structure of the table, from where I can parse the data and show on screen. But DESCRIBE doesn't seem to work on SQLite.. (I know there's a &lt;i&gt;&lt;b&gt;.describe &lt;/b&gt;&lt;/i&gt;command - but that works only with the command line tool)&lt;br&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Any help will be greatly appreciated. Code samples would be even better :)&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;m^e&lt;br&gt;</description></item><item><title>how to write and invoke your own UDF in any .NET language?</title><link>http://sqlite.phxsoftware.com/forums/thread/9700.aspx</link><pubDate>Mon, 26 Jul 2010 13:13:32 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9700</guid><dc:creator>timo888</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9700.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9700</wfw:commentRss><description>The description of the phxsoftware SQlite connectivity layer has this:

User-Defined Functions &amp;amp; Collating Sequences
Full support for user-defined functions and collating sequences means that in many cases if SQLite doesn&amp;#39;t have a feature, you can write it yourself in your favorite .NET language.  Writing UDF&amp;#39;s and collating sequences has never been easier.

Could someone give a bare-bones example of the steps involved in writing UDFs for SQLite  &amp;quot;in your favorite .NET language&amp;quot;, or provide a link where this is described in detail? 
Thanks</description></item><item><title>I am looking for a sample how to retrieve data from 2 tables, get a ResultSet and read the data</title><link>http://sqlite.phxsoftware.com/forums/thread/9698.aspx</link><pubDate>Sun, 25 Jul 2010 17:37:05 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9698</guid><dc:creator>Eluim</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9698.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9698</wfw:commentRss><description>Anyone could provide a simple code snippet in c#?</description></item><item><title>sqlite connect excel</title><link>http://sqlite.phxsoftware.com/forums/thread/9697.aspx</link><pubDate>Sun, 25 Jul 2010 11:14:27 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9697</guid><dc:creator>chris23879</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9697.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9697</wfw:commentRss><description>&lt;p&gt;Hi Guys,&lt;/p&gt;
&lt;p&gt;I have&amp;nbsp;an sqlite database that i&amp;nbsp;would like to extract data from, into and excel workbook.&lt;/p&gt;
&lt;p&gt;Please could somebody recomend the best way to do this.&lt;/p&gt;
&lt;p&gt;I belive&amp;nbsp;this can be dome using ODBC in the .net framework.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is a reference to using ODBC on&amp;nbsp;&lt;a href="http://www.connectionstrings.com/sqlite"&gt;http://www.connectionstrings.com/sqlite&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following is my an attempt.&lt;/p&gt;
&lt;p&gt;Global cnPubs As New Connection&lt;/p&gt;
&lt;p&gt;Sub OpenConnection()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39; Provide the connection string.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim strConn As String&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Use the SQL Server OLE DB Provider.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; strConn = &amp;quot;DRIVER=SQLite3 ODBC Driver;Database=H:\New Folder (2)\2010_06_11\aquagib2.sqlite;&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Now open the connection.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cnPubs.Open strConn&lt;br /&gt;End Sub&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Chris&lt;/p&gt;</description></item><item><title>Can't view SQLite.Interop vcproj properties for x64</title><link>http://sqlite.phxsoftware.com/forums/thread/9677.aspx</link><pubDate>Tue, 20 Jul 2010 21:20:20 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9677</guid><dc:creator>chadmein</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9677.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9677</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m trying to build the x64 version of the System.Data.SQLite.dll from source code and wanted to check the properties on the project file but I get an error...&lt;/p&gt;&lt;p&gt;&amp;quot;The operation could not be completed. Unspecified error.&amp;quot; &lt;/p&gt;&lt;p&gt;If&amp;nbsp; I change the platform from x64 to Win32 in the ConfigurationManager I can view the properties just fine.&amp;nbsp; It&amp;#39;s only when the platform on the solution is set to x64 that it causes this error.&lt;/p&gt;&lt;p&gt;I&amp;#39;m using an older version&amp;nbsp; 1.0.62 because I need to be on a specific version of the sqlite3.c file and this version of the System.Data.SQLite was the closest to that version.&lt;/p&gt;&lt;p&gt;Any help on how to fix this would be appreciated.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks! &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Do not call command.Text =... in a Delete/Insert loop, how make it better?</title><link>http://sqlite.phxsoftware.com/forums/thread/9672.aspx</link><pubDate>Mon, 19 Jul 2010 19:07:37 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9672</guid><dc:creator>Eluim</dc:creator><slash:comments>2</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9672.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9672</wfw:commentRss><description>I have this c# method: http://pastebin.com/KtNMpqrG

I do not know how I can take the com.CommandText and Parameters.Add out of the foreach loop. 

How would you do that?

  </description></item><item><title>Can't find PInvoke DLL "SQLite,Interop.DLL" on WinCE 4.1</title><link>http://sqlite.phxsoftware.com/forums/thread/9675.aspx</link><pubDate>Tue, 20 Jul 2010 12:56:49 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9675</guid><dc:creator>mhoop81</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9675.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9675</wfw:commentRss><description>I have a scanner app that I&amp;#39;ve written. SQLite .066 works fine on 4.2 and higher, but I&amp;#39;m getting a message Can&amp;#39;t find PInvoke DLL &amp;#39;SQLite.Interop.DLL&amp;#39;. on the 4.1. Could someone suggest a solution?</description></item><item><title>How to read related data from 2 tables into an aggregated collection?</title><link>http://sqlite.phxsoftware.com/forums/thread/9663.aspx</link><pubDate>Sun, 18 Jul 2010 10:56:38 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9663</guid><dc:creator>Eluim</dc:creator><slash:comments>5</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9663.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9663</wfw:commentRss><description>Hello,

I have 2 methods. Both work fine for its own... What I want is to retrieve with SQLite the SchoolclassCodeID from every pupil with the current SchoolclassCode and its SchoolclassCodeID property.

In the end I want to return a ObservableCollection where each SchoolclassCode object has 1 ObservableCollection with many pupil objects.

How would you do that with sqlite, 2 readers, 2 SQLiteCommands, 2 while loops etc...?

&lt;code&gt;
public IEnumerable GetSchoolclassCodeList()
        { 
            using (var trans = ConnectionManager.Connection.BeginTransaction())
            {
                SQLiteDataReader reader = null;
                try
                {
                    using (var com = new SQLiteCommand(ConnectionManager.Connection))
                    {
                        com.CommandText = &amp;quot;SELECT * FROM SCHOOLCLASSCODE&amp;quot;;                        
                        reader = com.ExecuteReader();

                        while (reader.Read())
                            yield return new SchoolclassCode() { SchoolclassCodeID = reader.GetInt32(0), SchoolclassName = reader.GetString(1) };                                                       
                    }
                    trans.Commit();                   
                }
                finally { reader.Close(); }
            }
        }

        public IEnumerable GetPupilList()
        {          
            using (var trans = ConnectionManager.Connection.BeginTransaction())
            {
                SQLiteDataReader reader = null;
                try
                {
                    using (var com = new SQLiteCommand(ConnectionManager.Connection))
                    {
                        com.CommandText = &amp;quot;SELECT * FROM PUPIL&amp;quot;;
                        reader = com.ExecuteReader();

                        while (reader.Read())
                            yield return new Pupil() { PupilID = reader.GetInt32(0), FirstName = reader.GetString(1), LastName = reader.GetString(2), SchoolclassCodeID = reader.GetInt32(3) };
                    }
                    trans.Commit();
                }                
                finally { reader.Close(); }
            }
        }
&lt;/code&gt;</description></item><item><title>Sample for DataGridView binding</title><link>http://sqlite.phxsoftware.com/forums/thread/8525.aspx</link><pubDate>Wed, 11 Nov 2009 00:15:45 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:8525</guid><dc:creator>m_ologin</dc:creator><slash:comments>7</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/8525.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=8525</wfw:commentRss><description>&lt;p&gt;Please redirect me if this has already been posted somewhere, but I&amp;#39;ve been looking all over for a simple full example of a C# DataGridView sample that binds a table to a database table and performs CRUD operations directly on it.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Does this exist anywhere? It seems like the first thing that should have come with this library... &lt;br /&gt;&lt;/p&gt;</description></item><item><title>publish my project error!</title><link>http://sqlite.phxsoftware.com/forums/thread/9638.aspx</link><pubDate>Tue, 13 Jul 2010 13:50:59 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9638</guid><dc:creator>jviure</dc:creator><slash:comments>6</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9638.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9638</wfw:commentRss><description>&lt;p&gt;Hello people!&amp;nbsp; I&amp;#39;m writing a desktop application using sqlite as database. I want to give a CD to a user and only installing the setup.exe start working. I thought&amp;nbsp; to use the sql server ce but finally I use sqlite. What happens is that if I execute the application in visual studio with debug or release mode the application runs perfect (I copied before my sqlite db in application_folder/bin/debug and application_folder/bin/release). But if I publish the application and try to execute the application in another computer this error is thrown: &lt;br /&gt;&lt;/p&gt;&lt;p&gt;http://www.glowfoto.com/static_image/13-080942L/4684/png/07/2010/img4/glowfoto&lt;/p&gt;&lt;p&gt;&amp;nbsp;If I execute the application in my computer but out of visual studio this error is not thrown but no database is found. Can you help how to continue? I wat to give this application to a friend but actually I can&amp;#39;t for this problems.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks! :) &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Dataset Update with DataAdapter and CommandBuilder Problem</title><link>http://sqlite.phxsoftware.com/forums/thread/9618.aspx</link><pubDate>Thu, 08 Jul 2010 15:44:43 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9618</guid><dc:creator>Tink</dc:creator><slash:comments>2</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9618.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9618</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hello,&lt;/p&gt;&lt;p&gt;New user here - evaluating SQLite in ADO to see if it can replace an existing database...&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Before I post any code along with my problem, I thought I would first describe it in case the answer was immediately obvious, because as I wrote above I am new to all of this.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;PREVIOUS database was an Access (JET) database using Microsoft&amp;#39;s ADO.NET with an OLEDB data adapter.&amp;nbsp; The way the application was architected, it would read (for example) 3 tables into a single DataSet, and use the OLEDB adapter to include schema information.&amp;nbsp; The DataSet was passed to another procedure where the data was compared with objects in memory and changes were made, then the DataSet was passed back to yet another procedure that would actually apply the updates. &amp;nbsp; In this scenario, the DataAdapter was not maintained through the procedures - a different adapter/connection was used for the update from the one that was originally used to fill the DataSet with the 3 tables.&amp;nbsp; (The 3 tables are related but not through a JOIN or anything like that.)&lt;/p&gt;&lt;p&gt;So here is the problem...&lt;/p&gt;&lt;p&gt;I first updated the procedures, not wanting to rewrite them entirely, and of course the update complained about not having the select statement/update statement.&amp;nbsp; So, I then added the CommandBuilder, but without the proper DataAdapter that of course did nothing either.&amp;nbsp; So then, I initialized a new data adapter (similiar select clause) but did not use it to fill the dataset (since it was already filled and modified), and used that to create the CommandBuilder.&amp;nbsp; However, while it returns no errors, it also does not apply a single update to the database!&lt;/p&gt;&lt;p&gt;So then I finally went and created an object that when the DataSet was created, would hold the resulting DataSet as well as the 3 DataAdapters used to get and fill the DataSet with the 3 tables.&amp;nbsp; I then passed those DataAdapters to the procedure that does the Update, but as you might guess, no joy.&amp;nbsp; It does not throw any errors/exceptions, it just does nothing to the table.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any guesses as to what is wrong?&lt;/p&gt;&lt;p&gt;Here is just a small snippet of the actual update procedure...&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim dc As SQLiteCommandBuilder&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim da As SQLiteDataAdapter&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; da = dsda.DA1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dc = New SQLiteCommandBuilder(da)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ds.AcceptChanges()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; da.Update(ds, &amp;quot;Events&amp;quot;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch ex As Exception&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WriteMon(&amp;quot;Error&amp;quot;, &amp;quot;SaveEvents(a) Error: &amp;quot; &amp;amp; ex.Message)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; da.Dispose()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Try&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .....(rest of the procedure) .....&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>VS 2008 C++ samples</title><link>http://sqlite.phxsoftware.com/forums/thread/8898.aspx</link><pubDate>Wed, 03 Feb 2010 18:24:44 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:8898</guid><dc:creator>stutak</dc:creator><slash:comments>3</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/8898.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=8898</wfw:commentRss><description>&lt;p&gt;Hi all.&lt;/p&gt;&lt;p&gt;Can someone give me working&amp;nbsp; c++ forms sample?&lt;/p&gt;&lt;p&gt;Because I cant find some tutorial/man and recieving lot of error...&lt;/p&gt;&lt;p&gt;For example:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System::String^ connection_string = &amp;quot;Data Source=C:\\test.db&amp;quot;;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQLiteConnection con = gcnew SQLiteConnection(connection_string);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; con.Open();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SQLiteCommand cmd = gcnew SQLiteCommand(con);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Here I&amp;#39;ve got error and I was unable to link command with connection(if I&amp;#39;ll write this code: &lt;/p&gt;&lt;p&gt;cmd.connection=con;//cannot convert parameter 1 from &amp;#39;System::Data::SQLite::SQLiteConnection&amp;#39; to &amp;#39;System::Data::Common::DbConnection ^&amp;#39;&lt;/p&gt;&lt;p&gt;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Would be great if someone got working c++ samples for:&lt;/p&gt;&lt;p&gt;1. Open database;&lt;/p&gt;&lt;p&gt;2. Insert data;&lt;/p&gt;&lt;p&gt;3. Read and display data; (is there way to read data in array[ ][ ] or something? ) &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thank You for this product. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Data Grid filling using SQLite</title><link>http://sqlite.phxsoftware.com/forums/thread/9558.aspx</link><pubDate>Wed, 23 Jun 2010 15:54:34 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9558</guid><dc:creator>nXqd</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9558.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9558</wfw:commentRss><description>I&amp;#39;m new to dataGrid filling by database . 
I&amp;#39;ve implemented to fill my datagrid with datas from a TABLE.
But know I want to have a search text box, so I can search through my database and show only record that match string.
Example my TABLE:
&lt;font face="Lucida Console" size="2"&gt;
CREATE TABLE [DAUSACH] (

[MaSach] INTEGER  NOT NULL PRIMARY KEY AUTOINCREMENT,

[TenSach] char(20)  NULL,

[TheLoai] char(15)  NULL,

[TacGia] char(50)  NULL,

[LuongTon] int  NULL
)
&lt;/font&gt;
This is what I do in windows form to fill my grid with all records from DAUSACH

&lt;font face="Lucida Console" size="2"&gt;dAUSACHTableAdapter.Fill(qLNSDataSet.DAUSACH);&lt;/font&gt;</description></item><item><title>HOWTO compiling my own...</title><link>http://sqlite.phxsoftware.com/forums/thread/9515.aspx</link><pubDate>Sun, 13 Jun 2010 19:36:52 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9515</guid><dc:creator>carleton</dc:creator><slash:comments>2</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9515.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9515</wfw:commentRss><description>&lt;p&gt;I would like to compile my own version of System.Data.SQLite.&amp;nbsp; I am using it in a standard .Net 3.5 project, not special other than the fact I have applied a patch that forces foreign keys to be on by default.&amp;nbsp; I see there are three different project variants of the System.Data.SQLite, Compact, ManagedOnly, and Netmodule.&amp;nbsp; What is the difference?&amp;nbsp; Which one should I be using? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Sam &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Writing parameterized queries</title><link>http://sqlite.phxsoftware.com/forums/thread/272.aspx</link><pubDate>Mon, 21 Nov 2005 20:30:42 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:272</guid><dc:creator>Robert Simpson</dc:creator><slash:comments>21</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/272.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=272</wfw:commentRss><description>&lt;P&gt;Parameterized queries are something often overlooked by developers.&amp;nbsp; It either looks confusing, or can't possibly be that important, or the developer wants more fine-tuned&amp;nbsp;control over their queries, the excuses go on.&amp;nbsp; If you're even remotely interested in maximizing performance, reducing SQL injection risks, or are deciding whether or not its worthwhile to rewrite your code to use parameterized queries, then please read on!&amp;nbsp; If you already know all about parameterized queries, just &lt;A&gt;skip to the end&lt;/A&gt; and read the syntax.&amp;nbsp; Perhaps the single greatest feature of parameterized queries is that every major database engine takes advantage of them!&amp;nbsp; What follows applies to &lt;STRONG&gt;all major database engines&lt;/STRONG&gt;, not just SQLite:&lt;/P&gt;
&lt;P&gt;First things first.&amp;nbsp; SQL (Structured Query Language) is an interpreted language.&amp;nbsp; Every time you execute a new SQL query the contents of the query must be parsed, an execution plan developed, memory allocated, etc.&amp;nbsp; Parsing SQL is an expensive operation, though usually not as expensive as accessing the underlying data the query references.&amp;nbsp; The decision on when to use paramterized queries is often influenced by a couple of factors:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Does the query involve input from the user? 
&lt;LI&gt;Am I executing essentially the same statement with slightly different input values repeatedly?&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If your code does either of these, you should consider using parameterized queries.&amp;nbsp; Take for example, the following loop:&lt;/P&gt;
&lt;TABLE&gt;

&lt;TR&gt;
&lt;TD style="BACKGROUND-COLOR: lightgrey"&gt;&lt;PRE&gt;string lookupValue;&lt;BR&gt;using (SQLiteCommand cmd = cnn.CreateCommand())&lt;BR&gt;{&lt;BR&gt;  for (int i = 0; i &amp;lt; 100; i++)&lt;BR&gt;  {&lt;BR&gt;    lookupValue = getSomeLookupValue(i);&lt;BR&gt;    cmd.CommandText = @"UPDATE [Foo] SET [Value] = [Value] + 1&lt;BR&gt;                        WHERE [Customer] LIKE '" + lookupValue + "'";&lt;BR&gt;    cmd.ExecuteNonQuery();&lt;BR&gt;&lt;BR&gt;  }&lt;BR&gt;}&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
&lt;P&gt;Now this code may look innocent enough, but it suffers some performance penalties and some security risks.&amp;nbsp; First, the CommandText has to be re-evaluated every time the command is executed.&amp;nbsp; SQLite must parse the statement and construct a query plan 100 times in this loop.&amp;nbsp; There are also a lot of memory allocations being done here.&amp;nbsp; The previously-prepared CommandText is freed, the new CommandText allocated.&amp;nbsp; A statement is compiled and strings are concatenated causing even more allocations and deallocations.&amp;nbsp; There are also a great number of interop calls being performed behind the scenes.&lt;/P&gt;
&lt;P&gt;If &lt;STRONG&gt;lookupValue&lt;/STRONG&gt; is unknown, provided by the user, or can be altered externally, this statement becomes a risk for an injection attack.&amp;nbsp; Imagine what would happen if the &lt;STRONG&gt;lookupValue&lt;/STRONG&gt; contained the string &lt;STRONG&gt;&lt;EM&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt;'; DELETE FROM Foo; SELECT '&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now put that statement together and you have:&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT style="BACKGROUND-COLOR: #d3d3d3" face="Courier New" size=2&gt;UPDATE [Foo] SET [Value] = [Value] + 1&lt;BR&gt;WHERE [Customer] LIKE ''; DELETE FROM Foo; SELECT ''&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Now this is a disastrous injection attack.&amp;nbsp; The very least you'll have to do&amp;nbsp;to defend against this is double any single quotes that may appear in &lt;STRONG&gt;lookupValue&lt;/STRONG&gt;, which of course is yet another step in the whole loop that will slow things down.&lt;/P&gt;
&lt;P&gt;Parameterized queries provide a means to minimize all this impact.&amp;nbsp; With a parameterized query, the CommandText is set only once at the beginning of the loop.&amp;nbsp; The &lt;STRONG&gt;lookupValue&lt;/STRONG&gt; becomes a parameter, assigned within the loop, and the command is executed over and over without having to do any extra parsing.&amp;nbsp; Furthermore, since the parameter is&amp;nbsp;a string variable and the SQL statement has already been prepared, it is not vulnerable to an injection attack.&lt;/P&gt;&lt;A name=syntax&gt;&lt;/A&gt;
&lt;P&gt;SQLite supports named and unnamed parameters.&amp;nbsp; Named parameters must appear in the SQL statement with either a &lt;STRONG&gt;$&lt;/STRONG&gt; (dollar), &lt;STRONG&gt;:&lt;/STRONG&gt; (colon) or &lt;STRONG&gt;@&lt;/STRONG&gt; (at sign) prefix.&amp;nbsp; Unnamed parameters consist of a single question mark ? character.&amp;nbsp; Rewriting the above code to&amp;nbsp;use a named parameter looks like this:&lt;/P&gt;
&lt;TABLE&gt;

&lt;TR&gt;
&lt;TD style="BACKGROUND-COLOR: lightgrey"&gt;&lt;PRE&gt;&lt;PRE&gt;using (SQLiteCommand cmd = cnn.CreateCommand())&lt;BR&gt;{&lt;BR&gt;  cmd.CommandText = @"UPDATE [Foo] SET [Value] = [Value] + 1&lt;BR&gt;                      WHERE [Customer] LIKE @lookupValue";&lt;BR&gt;  SQLiteParameter lookupValue = new SQLiteParameter("@lookupValue");&lt;BR&gt;  cmd.Parameters.Add(lookupValue);&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;  for (int i = 0; i &amp;lt; 100; i++)&lt;BR&gt;  {&lt;BR&gt;    lookupValue.Value = getSomeLookupValue(i);&lt;BR&gt;    cmd.ExecuteNonQuery();&lt;BR&gt;&lt;BR&gt;  }&lt;BR&gt;}&lt;/PRE&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
&lt;P&gt;The same code now using an unnamed parameter (compatible with Jet/Access)&lt;/P&gt;
&lt;TABLE&gt;

&lt;TR&gt;
&lt;TD style="BACKGROUND-COLOR: lightgrey"&gt;&lt;PRE&gt;&lt;PRE&gt;using (SQLiteCommand cmd = cnn.CreateCommand())&lt;BR&gt;{&lt;BR&gt;  cmd.CommandText = @"UPDATE [Foo] SET [Value] = [Value] + 1&lt;BR&gt;                      WHERE [Customer] LIKE ?";&lt;BR&gt;  SQLiteParameter lookupValue = new SQLiteParameter();&lt;BR&gt;  cmd.Parameters.Add(lookupValue);&lt;/PRE&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;PRE&gt;  for (int i = 0; i &amp;lt; 100; i++)&lt;BR&gt;  {&lt;BR&gt;    lookupValue.Value = getSomeLookupValue(i);&lt;BR&gt;    cmd.ExecuteNonQuery();&lt;BR&gt;&lt;BR&gt;  }&lt;BR&gt;}&lt;/PRE&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;
&lt;P&gt;For simplicity I didn't wrap these functions inside a transaction which would have made them significantly faster.&amp;nbsp; Even still, the amount of processing that must be done for the parameterized queries are a fraction of the original.&amp;nbsp; When performing&amp;nbsp;a bulk update or insert, or executing a query using outside information, parameterized queries are a clear winner.&lt;/P&gt;
&lt;P&gt;Robert&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description></item><item><title>Can't Find PInvoke DLL SQLite.Interop.DLL - I copied it to project root but still not working</title><link>http://sqlite.phxsoftware.com/forums/thread/9343.aspx</link><pubDate>Thu, 29 Apr 2010 07:03:58 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9343</guid><dc:creator>Gus</dc:creator><slash:comments>9</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9343.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9343</wfw:commentRss><description>&lt;p&gt;It&amp;#39;s kind of regular problem there. But I can do nothing for it. Pls help me find it out, thanks a lot. &lt;/p&gt;
&lt;p&gt;.NET 2.0&amp;nbsp; +&amp;nbsp; VS 2005&amp;nbsp; + windows mobile 6 pro +&amp;nbsp; C#&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have copied the CF version of System.Data.SQLite.DLL and SQLite.Interop.066.DLL. &lt;/p&gt;&lt;img alt="" /&gt;&amp;nbsp; &lt;img alt="" /&gt; 
&lt;p&gt;Whatever I&amp;nbsp;did, on real device (build app cab, include SQLite.Interop.DLL) or use emulator (I&amp;#39;m so sure that I followed the solution&amp;nbsp;of other cases like this), it always show the error msg - Can&amp;#39;t Find PInvoke DLL SQLite.Interop.DLL.&lt;/p&gt;
&lt;p&gt;tks&lt;/p&gt;</description></item><item><title>Inserting cyrillic with parameter</title><link>http://sqlite.phxsoftware.com/forums/thread/9530.aspx</link><pubDate>Wed, 16 Jun 2010 20:34:01 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9530</guid><dc:creator>jaynakus</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9530.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9530</wfw:commentRss><description>&lt;p&gt;What should I do to insert cyrillic text with parameters?&lt;/p&gt;&lt;p&gt;Where I insert the data is something like Р‘РёС„РѕСЃРёРЅ it is truly not cyrillic.&lt;/p&gt;&lt;p&gt;However, when I try to insert by other management application like SQLite Administrator to the same db it is ok.&lt;/p&gt;&lt;p&gt;&amp;nbsp;What is wrong with my Insert command? It is has named parameters, and values are given normally.&lt;/p&gt;&lt;p&gt;&amp;quot;insert into sos12(id,naimex) values(@id,@naimex)&amp;quot;&lt;/p&gt;&lt;p&gt;where datatype of naimex is text&lt;/p&gt;&lt;p&gt;Please help.... &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Retrieving BLOB data from an old sqlite database</title><link>http://sqlite.phxsoftware.com/forums/thread/9505.aspx</link><pubDate>Sat, 05 Jun 2010 17:42:55 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9505</guid><dc:creator>skyjt</dc:creator><slash:comments>1</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9505.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9505</wfw:commentRss><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;I had been using a C++ wrapper for SQLite to store image data as BLOBs in a table. Before the data is stored, it was encoded using the old sqlite_encode_binary function (which I think is no longer available). So my problem is that after porting the code to C#, the data which used to be stored in the database can no longer to retrieved with System.Data.SQLite without some transformation.&lt;/p&gt;
&lt;p&gt;I managed to find the source code for the sqlite_decode_binary function and managed to transform the data back into JPEG data with some success, but the images are still corrupted (will display but has corrupted lines, some more so than others). I suspect that when the file is read as a BLOB, there is some level of decoding done (perhaps to properly encode certain characters?) before it is read back out. However, I can&amp;#39;t seem to figure out what this decoding is. Would anyone be able to help?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;br /&gt;Jerome&lt;/p&gt;</description></item><item><title>Using the Backup API</title><link>http://sqlite.phxsoftware.com/forums/thread/9511.aspx</link><pubDate>Thu, 10 Jun 2010 23:18:15 GMT</pubDate><guid isPermaLink="false">fa762dca-388a-4e6a-93ef-b5a7a7439be2:9511</guid><dc:creator>abrakjamson</dc:creator><slash:comments>0</slash:comments><comments>http://sqlite.phxsoftware.com/forums/thread/9511.aspx</comments><wfw:commentRss>http://sqlite.phxsoftware.com/forums/commentrss.aspx?SectionID=10&amp;PostID=9511</wfw:commentRss><description>If you&amp;#39;re here, you&amp;#39;ve realized that System.Data.SQLite does not support  the SQLite &lt;a href="http://www.sqlite.org/c3ref/backup_finish.html" target="_blank" title="http://www.sqlite.org/c3ref/backup_finish.html"&gt;Online Backup API&lt;/a&gt;. If you absolutely can&amp;#39;t wait until it is supported, I&amp;#39;ve found a solution.&lt;br /&gt;
&lt;br /&gt;
If you want to copy a .db3 file to another .db3 file, you should either use the copy file API of your operating system, or &lt;a href="http://sqlite.phxsoftware.com/forums/p/2359/9382.aspx#9382" target="_blank" title="http://sqlite.phxsoftware.com/forums/p/2359/9382.aspx#9382"&gt;RogerIrwin&amp;#39;s method&lt;/a&gt;. Use the following method only if you need to back up your in-memory database and you like kludgey solutions.&lt;br /&gt;
&lt;br /&gt;
This will require downloading the System.Data.SQLite source, modifying it, and recompiling. Basically, you need to be able to access the _sql property of the SQLite3.cs class. &lt;br /&gt;
&lt;br /&gt;
Make the following classes public:&lt;br /&gt;
&lt;ul class="anf_list"&gt;
&lt;li&gt;SQLite3
&lt;/li&gt;&lt;li&gt;SQLiteBase
&lt;/li&gt;&lt;li&gt;SQLiteConnection
&lt;/li&gt;&lt;li&gt;SQLiteConvert
&lt;/li&gt;&lt;li&gt;CriticalHandle and SQLiteConnectionHandle in UnsafeNativeMethods.cs
&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;
Make a public accessor for the _sql property of the SQLiteConnection class. This will allow you to retrieve the SQLite3 object created with your connection.&lt;br /&gt;
&lt;br /&gt;
Make a public accessor for the _sql property of the SQLite3 class. Mine returns an IntPtr instead of a SQLiteConnectionHandle so it doesn&amp;#39;t have to be converted later. This allows you to get the handle of your database to use in the API.&lt;br /&gt;
&lt;br /&gt;
When you compile, make sure to use Release mode, and select the platform you are using. The dll that is created should be closer to 800kB than 100kB.&lt;br /&gt;
&lt;br /&gt;
Now, in your project you need to link some external functions manually.&lt;br /&gt;&lt;br /&gt;
&lt;code&gt;
        [DllImport(&amp;quot;System.Data.SQLite.DLL&amp;quot;, CharSet = CharSet.Auto)]&lt;br /&gt;
        internal static extern int sqlite3_open(byte[&amp;#93; filename, out IntPtr db);&lt;br /&gt;
&lt;br /&gt;
        [DllImport(&amp;quot;System.Data.SQLite.DLL&amp;quot;, CharSet = CharSet.Auto)]&lt;br /&gt;
        internal static extern int sqlite3_close(IntPtr db);&lt;br /&gt;
&lt;br /&gt;
        [DllImport(&amp;quot;System.Data.SQLite.DLL&amp;quot;, CharSet = CharSet.Auto)]&lt;br /&gt;
        internal static extern IntPtr sqlite3_backup_init(IntPtr destDb, byte[&amp;#93; destname, IntPtr srcDB, byte[&amp;#93; srcname);&lt;br /&gt;
&lt;br /&gt;
        [DllImport(&amp;quot;System.Data.SQLite.DLL&amp;quot;, CharSet = CharSet.Auto)]&lt;br /&gt;
        internal static extern int sqlite3_backup_step(IntPtr backup, int pages);&lt;br /&gt;
&lt;br /&gt;
        [DllImport(&amp;quot;System.Data.SQLite.DLL&amp;quot;, CharSet = CharSet.Auto)]&lt;br /&gt;
        internal static extern int sqlite3_backup_finish(IntPtr backup);&lt;br /&gt;
&lt;/code&gt;&lt;br /&gt;
And here is my method to do the backup.&lt;br /&gt;&lt;br /&gt;
&lt;code&gt;
/// summary&lt;br /&gt;
/// Backs up the in-memory database to the specified file.&lt;br /&gt;
/// /summary&lt;br /&gt;
/// param name=&amp;quot;filename&amp;quot; The filename. /param&lt;br /&gt;
/// returns 0 if successful; otherwise, an SQLite error code. /returns&lt;br /&gt;
public int BackupDatabaseToFile(string filename)&lt;br /&gt;
        {&lt;br /&gt;
&amp;nbsp; IntPtr backup = new IntPtr();&lt;br /&gt;
&amp;nbsp; IntPtr destDB = new IntPtr();&lt;br /&gt;
&amp;nbsp; IntPtr memDB = new IntPtr();&lt;br /&gt;
&amp;nbsp; int returnCode;&lt;br /&gt;
&amp;nbsp; var encoding = new System.Text.UTF8Encoding();&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; byte[&amp;#93; destName = encoding.GetBytes(filename);&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; //get the handle to the memory database&lt;br /&gt;
&amp;nbsp; IDbConnection iconn = ConnectionProvider.GetConnection();&lt;br /&gt;
&amp;nbsp; SQLiteConnection conn = (SQLiteConnection)iconn;&lt;br /&gt;
&amp;nbsp; SQLite3 database = conn.Sql as SQLite3;&lt;br /&gt;
&amp;nbsp; memDB = database.Sql;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; //the rest is similar to the SQLite C examples&lt;br /&gt;
&amp;nbsp; //open the file for writing&lt;br /&gt;
&amp;nbsp; returnCode = sqlite3_open(destName, out destDB);&lt;br /&gt;
&amp;nbsp; if (returnCode == 0)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp; //begin the backup&lt;br /&gt;
&amp;nbsp;&amp;nbsp; backup = sqlite3_backup_init(destDB, encoding.GetBytes(&amp;quot;main&amp;quot;), memDB,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;                                        encoding.GetBytes(&amp;quot;main&amp;quot;));&lt;br /&gt;
&amp;nbsp;&amp;nbsp; if (backup != IntPtr.Zero)&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlite3_backup_step(backup, -1);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; sqlite3_backup_finish(backup);&lt;br /&gt;
&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp; returnCode = sqlite3_errcode(destDB);&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; //close the file, but not the memory database&lt;br /&gt;
&amp;nbsp; sqlite3_close(destDB);&lt;br /&gt;
&amp;nbsp; return returnCode;&lt;br /&gt;
}&lt;br /&gt;
&lt;/code&gt;
&lt;br /&gt;
Note: Use this at your own risk. There is a reason I&amp;#39;m not submitting this as a patch - it&amp;#39;s not consistent with the framework and may be insecure.</description></item></channel></rss>