namespace Test { class Program { public static SQLiteConnection m_dbConnection; static void Main(string[] args) { m_dbConnection = new SQLiteConnection(@"Data Source=https://dl.mydomain.com/Urls.sqlite"); m_dbConnection.Open(); test(); } private static void test() { String query = "SELECT * FROM table"; SQLiteCommand prepQuery = new SQLiteCommand(query, m_dbConnection); SQLiteDataReader reader = prepQuery.ExecuteReader(); Console.WriteLine(reader["testcolumn"].ToString()); } } }
Quote: Server-side database Systems designers report success using SQLite as a data store on server applications running in the datacenter, or in other words, using SQLite as the underlying storage engine for an application-specific database server. With this pattern, the overall system is still client/server: clients send requests to the server and get back replies over the network. But instead of sending generic SQL and getting back raw table content, the client requests and server responses are high-level and application-specific. The server translates requests into multiple SQL queries, gathers the results, does post-processing, filtering, and analysis, then constructs a high-level reply containing only the essential information. Developers report that SQLite is often faster than a client/server SQL database engine in this scenario. Database requests are serialized by the server, so concurrency is not an issue. Concurrency is also improved by "database sharding": using separate database files for different subdomains. For example, the server might have a separate SQLite database for each user, so that the server can handle hundreds or thousands of simultaneous connections, but each SQLite database is only used by one connection. ... Situations Where A Client/Server RDBMS May Work Better Client/Server Applications If there are many client programs sending SQL to the same database over a network, then use a client/server database engine instead of SQLite. SQLite will work over a network filesystem, but because of the latency associated with most network filesystems, performance will not be great. Also, file locking logic is buggy many network filesystem implementations (on both Unix and Windows). If file locking does not work correctly, two or more clients might try to modify the same part of the same database at the same time, resulting in corruption. Because this problem results from bugs in the underlying filesystem implementation, there is nothing SQLite can do to prevent it.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)