<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Create and Connect to SQLite Database (DB) in C# in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10875551#M21418</link>
    <description>&lt;P&gt;As the title suggests I need to create and connect to a SQL DB to start. I know there are many specific forums for it but I am here because I have gotten it to fully work in the Revit context via Python but having difficulty translating it to C# in context to the Revit API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create a new db by:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;                string filePath = @"C:\Users\User\Desktop\Test.db";
                
                SQLiteConnection.CreateFile(filePath);&lt;/LI-CODE&gt;&lt;P&gt;But when I try to open the connection, it does not work.&amp;nbsp; (Code just terminates/fails).&lt;/P&gt;&lt;LI-CODE lang="general"&gt;string ds = "Data Source=" + filePath + ";Version=3;";
SQLiteConnection c = new SQLiteConnection(ds);
c.Open();&lt;/LI-CODE&gt;&lt;P&gt;I've tried many configurations, such as:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;placing the code in a try/catch block&lt;/LI&gt;&lt;LI&gt;formatting the ds string different ways&lt;/LI&gt;&lt;LI&gt;writing the connection line with a using statement&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;but they all fail. This should be the simplest step but it appears I am missing something. Can anyone who has gotten SQLite connections to work via C# shed any light to this? Thank you.&lt;/P&gt;</description>
    <pubDate>Wed, 12 Jan 2022 22:05:53 GMT</pubDate>
    <dc:creator>rvtquestions</dc:creator>
    <dc:date>2022-01-12T22:05:53Z</dc:date>
    <item>
      <title>Create and Connect to SQLite Database (DB) in C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10875551#M21418</link>
      <description>&lt;P&gt;As the title suggests I need to create and connect to a SQL DB to start. I know there are many specific forums for it but I am here because I have gotten it to fully work in the Revit context via Python but having difficulty translating it to C# in context to the Revit API.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can create a new db by:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;                string filePath = @"C:\Users\User\Desktop\Test.db";
                
                SQLiteConnection.CreateFile(filePath);&lt;/LI-CODE&gt;&lt;P&gt;But when I try to open the connection, it does not work.&amp;nbsp; (Code just terminates/fails).&lt;/P&gt;&lt;LI-CODE lang="general"&gt;string ds = "Data Source=" + filePath + ";Version=3;";
SQLiteConnection c = new SQLiteConnection(ds);
c.Open();&lt;/LI-CODE&gt;&lt;P&gt;I've tried many configurations, such as:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;placing the code in a try/catch block&lt;/LI&gt;&lt;LI&gt;formatting the ds string different ways&lt;/LI&gt;&lt;LI&gt;writing the connection line with a using statement&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;but they all fail. This should be the simplest step but it appears I am missing something. Can anyone who has gotten SQLite connections to work via C# shed any light to this? Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jan 2022 22:05:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10875551#M21418</guid>
      <dc:creator>rvtquestions</dc:creator>
      <dc:date>2022-01-12T22:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Create and Connect to SQLite Database (DB) in C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10876375#M21419</link>
      <description>&lt;P&gt;Fundamentally there is no significant difference between .NET in Python and C#.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you share a minimal complete Python sample code snippet that successfully completes the db connection?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 07:35:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10876375#M21419</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-01-13T07:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Create and Connect to SQLite Database (DB) in C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10876546#M21420</link>
      <description>&lt;P&gt;I use sqlite in my revit app and it work like charm, but I only put path to connection. What nuget do you use?&lt;BR /&gt;try doing it in application out side revit to see where problem is.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 09:01:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10876546#M21420</guid>
      <dc:creator>MarryTookMyCoffe</dc:creator>
      <dc:date>2022-01-13T09:01:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create and Connect to SQLite Database (DB) in C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10877171#M21421</link>
      <description>&lt;P&gt;Hi Jeremy! Sure, in Python the aforementioned steps would be easily achieved by writing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;import sqlite3

conn = sqlite3.connect(r'C:\Users\User\Desktop\Test.db')&lt;/LI-CODE&gt;&lt;P&gt;and then you can follow by executing lines of commands but that is beyond the scope of the initial question.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 14:24:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10877171#M21421</guid>
      <dc:creator>rvtquestions</dc:creator>
      <dc:date>2022-01-13T14:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create and Connect to SQLite Database (DB) in C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10877184#M21422</link>
      <description>&lt;P&gt;I believe the packages are as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.Data.SQLite v.1.0.115&lt;/P&gt;&lt;P&gt;System.Data.SQLite.Core v.1.0.115.5&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 14:27:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10877184#M21422</guid>
      <dc:creator>rvtquestions</dc:creator>
      <dc:date>2022-01-13T14:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create and Connect to SQLite Database (DB) in C#</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10877605#M21423</link>
      <description>&lt;P&gt;I would suggest taking a look at the internal implementation of the `connect` method in the Python sqlite3 package. It is open source, isn't it? Then, you can simply reproduce the same steps in C#.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jan 2022 16:40:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/create-and-connect-to-sqlite-database-db-in-c/m-p/10877605#M21423</guid>
      <dc:creator>jeremy_tammik</dc:creator>
      <dc:date>2022-01-13T16:40:18Z</dc:date>
    </item>
  </channel>
</rss>

