Hi,
sorry for the delay.
Here is the Info

Table definition:
CREATE TABLE next_key (max_key NUMERIC, next_key NUMERIC);
 
Snippet>>>>>>>>>>>>>>>>>>>>>>>>>
        try{
        [void][System.Reflection.Assembly]::LoadFrom("D:\Program
Files\System.Data.SQLite\2008\bin\x32\System.Data.SQLite.dll")
        }
        catch
        {
        [void][System.Reflection.Assembly]::LoadFrom("C:\Program
Files\System.Data.SQLite\2008\bin\x32\System.Data.SQLite.dll")
        }               
                $template = $listbox2.text
        $cn = New-Object -TypeName System.Data.SQLite.SQLiteConnection
        $cn.ConnectionString = "Data Source=\\..."
        $cn.Open()
        #
        $cm = New-Object -TypeName System.Data.SQLite.SQLiteCommand
        $sql = "SELECT * FROM next_key"
        $cm.Connection = $cn
        #$cm1.connection = $cn
        $cm.CommandText = $sql
        $dr = $cm.ExecuteReader()
        while($dr.read()){
                $max_key = $dr.getint32(0)
                $current_key = $dr.getint32(1)
                if ($current_key -eq $max_key) {
                        $next_key = 1
                }
                else {
                        $next_key = $current_key + 1
                }
        }
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

> -----Ursprüngliche Nachricht-----
> Von: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-
> boun...@sqlite.org] Im Auftrag von Joe Mistachkin
> Gesendet: Freitag, 11. April 2014 21:02
> An: 'General Discussion of SQLite Database'
> Betreff: Re: [sqlite] Problems with executereader in System.Data.SQLite
> 
> 
> Ralf Jantschek wrote:
> >
> > I have the following table:
> >
> > Table:
> >
> >                 Field1    Field2
> >
> > 1                    2
> >
> 
> Could you please show the schema for the table involved in this query?
> 
> >
> > I am trying to access the values with
> >
> > "Select * from table;"
> >
> > But the select doesn't return "1 2" as expected, it returns the
> > FieldCount which is 2
> >
> > I  am accessing SQlite in a powershell script
> >
> 
> Could you also please show the PowerShell script that is being used to
> load the System.Data.SQLite assembly and to execute the query?
> 
> --
> Joe Mistachkin
> 
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to