2007-05-05, 12:37 PM
Using Finisar.SQLite DLLs here.
I have a simple C# program to output the capture sources
I added a reference to SQLite.Net.dll. When I run the program, I get an exception on sqconn.Open(). Any idea what I have wrong?
I have a simple C# program to output the capture sources
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Finisar.SQLite;
namespace sqltest
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SQLiteConnection sqconn;
string dbpath = "c:\\temp\\gbpvr.db3";
string strconn = "Data Source=" + dbpath + ";Version=3;";
sqconn = new SQLiteConnection(strconn);
sqconn.Open();
int i = 1;
bool result = false;
do
{
string strSQL = "SELECT * FROM CAPTURE_SOURCE WHERE oid='" + i.ToString() + "'";
SQLiteCommand sqc = new SQLiteCommand(strSQL, sqconn);
SQLiteDataReader sqr = sqc.ExecuteReader();
result = sqr.Read();
if (result)
{
int alloc_order = (int) sqr["allocation_order"];
listBox1.Items.Add(alloc_order.ToString() + " " + sqr["name"]);
i++;
}
} while (result);
sqconn.Close();
}
}
}
I added a reference to SQLite.Net.dll. When I run the program, I get an exception on sqconn.Open(). Any idea what I have wrong?
NPVR 4.1.0.180302 o Kodi 17.6 o EventGhost 0.5.0.rc4 o SAF 6.3.2 o SchedulesDirect
[SIZE="1"]
Case: Apevia X-Qpack HTPC o Motherboard: Asus P8H67-MLE o CPU: Intel Core i3-2100 o RAM: 8 GB o OS: Win7 64-bit
Tuner: HDHomeRun dual tuner o Leaf SkyHDTV antenna o Remote: Microsoft MCE
Hard drives: Samsung 500 GB SSD, Seagate 2 TB SATA2, Samsung 540 GB SATA2 o Input: Logitech USB keyboard & mouse
Video: ATI Radeon 7750 o Monitor: Viewsonic 27" VX2703MH-LED, LG 55" LCD TV
[/SIZE]
[SIZE="1"]
Case: Apevia X-Qpack HTPC o Motherboard: Asus P8H67-MLE o CPU: Intel Core i3-2100 o RAM: 8 GB o OS: Win7 64-bit
Tuner: HDHomeRun dual tuner o Leaf SkyHDTV antenna o Remote: Microsoft MCE
Hard drives: Samsung 500 GB SSD, Seagate 2 TB SATA2, Samsung 540 GB SATA2 o Input: Logitech USB keyboard & mouse
Video: ATI Radeon 7750 o Monitor: Viewsonic 27" VX2703MH-LED, LG 55" LCD TV
[/SIZE]