funktioniert leider auch nicht...
Hier mal der komplette Quellcode:
Code:
/*
* Erstellt mit SharpDevelop.
* Benutzer: Sandra
* Datum: 04.01.2008
* Zeit: 18:08
*
* Sie können diese Vorlage unter Extras > Optionen > Codeerstellung > Standardheader ändern.
*/
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using Finisar.SQLite;
namespace Datenbank
{
/// <summary>
/// Description of MainForm.
/// </summary>
public partial class MainForm : Form
{
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, EventArgs e)
{
SQLiteConnection sqlite_conn;
SQLiteCommand sqlite_cmd;
SQLiteDataReader sqlite_datareader;
sqlite_conn = new SQLiteConnection("Data Source=database.db;Version=3;New=False;Compress=False;");
sqlite_conn.Open();
sqlite_cmd = sqlite_conn.CreateCommand();
sqlite_cmd.CommandText = "INSERT INTO wetterdaten (grad) VALUES ('Test Text 1')";
sqlite_cmd.ExecuteNonQuery();
sqlite_cmd.CommandText = "SELECT * FROM test";
sqlite_datareader=sqlite_cmd.ExecuteReader();
while (sqlite_datareader.Read())
{
textBox1.Text = sqlite_datareader["text"].ToString();
}
sqlite_conn.Close();
}
}
}