database - Adapter not loading anything with SQLite C# -
I use this code and say SQLite "Data source can not be empty. Usage: Memory: In-memory To open the database "
This is my code
string dbfile = new system.IO.FileInfo (System.Reflection.Assembly.GetExecutingAssembly (.pace location). Name of the directory + "\\ m23 .db"; String sql; Date time DT = Date time.Now; SQLiteConnection connection = New SQLiteConnection ("Data Source =" + dbfile); SQLiteDataAdapter adapter = New SQLiteDataAdapter ("Select from p_posts", connection); Dataset data = new dataset (); Adapter.fill (data); // & lt; & Lt; & Lt; Here I get the error SQLiteCommand CMD = New SQLiteCommand (); Cmd.CommandType = CommandType.TableDirect; CMD. Connection = connection; Connection.Open ();
Any help is apreciated, cheers!
Try to use
SQLiteConnection connection = New SQLiteConnection ("Data Source =" + Dbfile);
I have seen the use of "data source" instead of "data source".
Comments
Post a Comment