Transfer datagrid content to SQLite db


Can someone tell me best way how to insert all data from datagrid to SQLite db ? Should i loop through  datagrid columns (how? ) or...?

Who is Participating?
lexxwernConnect With a Mentor Commented:
Okay.. assuming the dataProvider is a ArrayCollection, this is the code for looping:

// import ArrayCollection from collections package
var dataGridDataProvider:ArrayCollection = ArrayCollection(dataGridId.dataProvider);
var dataObject:Object;
for each( dataObject in dataGridDataProvider ) {
  // insert/update query here..

Open in new window

Go to (this main website)

1. On the right-hand side in bold letters is a section labled "Downloads"
2. Click on "Latest File Releases for the ADO.NET 2.0 Provider"
3. Scroll down to where you see "SQLite-" and click it
4. Pick a mirror to download the file from and click download
5. Save it to disk and run it
download the MSI file and install it.  When you're done, you'll find it in C:\Program Files\SQLite.NET\bin

Most people use the DLL along with a development environment.  Having an installer allows me to make sure that the DLL integrates properly with that development environment, and also allows me to make sure that prior of the distribution are cleaned up properly.

The DLL comes in 4 flavors -- x86, ARM, x64 and Itanium.  There are also other files, such as a readme, help file and other files only used by developers that aren't part of the redistributable portion but are useful nonetheless.

It's too confusing to have 6 different download links depending on CPU, source, development tools, etc.  I don't have time to rebuild all that every time I make a new release.

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

A simple reference code for connection from vb will be

Public sub new()
            Conn = New SQLiteConnection("Data Source=C:\Inetpub\wwwroot\sqlite\App_Data\users.db;providerName=System.Data.SQLite")
      End sub
===code class users.vb =======
    Imports System.Data
    Imports System.Security
    Imports System.Text
    Imports System.Data.SQLite
    Public Class User
      Public Id As Integer
      Public Name As String
      Public Email As String
      Public Conn As SQLiteConnection
    Conn = New SQLiteConnection("Data Source=C:\Inetpub\wwwroot\sqlite\App_Data\users.db;providerName=System.Data.SQLite")

Open in new window

mfhorizon, I think you have accidentally posted a VB solution, not Flex.

Didica, Your approach could be to parse through the dataProvider of the DataGrid one row at a time and execute a Insert/Update query as required by your application..
DidicaAuthor Commented:
lexxwern, yes i thought about that too and think that it could be best solution, but can you please show me how to do it. I mean i  would need AS code which will loop through dataprovide.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.