Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Transfer datagrid content to SQLite db

Posted on 2009-04-14
6
Medium Priority
?
623 Views
Last Modified: 2013-11-11
Hello,

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

Tnx
0
Comment
Question by:Didica
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24137488
Go to http://sqlite.phxsoftware.com (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-1.0.35.1-binary.msi" and click it
4. Pick a mirror to download the file from and click download
5. Save it to disk and run it
0
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24137497
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.


0
 
LVL 5

Expert Comment

by:mfhorizon
ID: 24137504
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")
            conn.Open()
      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")
    Conn.Open()

Open in new window

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 12

Expert Comment

by:lexxwern
ID: 24138027
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..
0
 

Author Comment

by:Didica
ID: 24140166
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.

Tnx
0
 
LVL 12

Accepted Solution

by:
lexxwern earned 1000 total points
ID: 24144702
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

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question