|
Как получить данные из SQLite в C#
|
|||
---|---|---|---|
#18+
Здравствуйте, не могу получить значения из базы SQLite using System.Data.SQLite; using System.Windows; using System.Data; using System.Data.SqlClient; ... DataTable datatabl = new DataTable(); public void Zanesti_dannie_v_tablicy() { SQLiteConnection connection = new SQLiteConnection(string.Format("Data Source={0};", databaseName)); try { connection.Open(); string sqlCommand = "SELECT * FROM test "; SQLiteCommand mycommand = new SQLiteCommand(sqlCommand, connection); //SQLiteDataReader reader = mycommand.ExecuteReader(); //dt.Load(reader); //reader.Close(); // SQLiteDataAdapter adapter = new SQLiteDataAdapter(); // adapter.SelectCommand = new SQLiteCommand("SELECT * FROM test ",connection); // adapter.Fill(datatabl); SQLiteDataReader reader = mycommand.ExecuteReader(); datatabl.Load(reader); reader.Close(); connection.Close(); } catch (Exception) { MessageBox.Show("Оёёй!"); } } ------------------------------- Студия выдала вообще какой-то бред "Строка не распознана как действительное значение DateTime". При чём тут DateTime.. Подскажите пожалуйста, как прочитать из базы и занести в таблицу. Спасибо ... |
|||
:
Нравится:
Не нравится:
|
|||
10.04.2013, 14:15 |
|
|
start [/forum/topic.php?fid=20&tid=1404862]: |
0ms |
get settings: |
8ms |
get forum list: |
12ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
200ms |
get topic data: |
11ms |
get forum data: |
2ms |
get page messages: |
48ms |
get tp. blocked users: |
2ms |
others: | 327ms |
total: | 618ms |
0 / 0 |