Accessing directly a Sql Server Database in Xamarin.Forms

You cannot access directly an sql server from your pcl project in Xamarin.Forms because System.Data.SqlClient is not available on pcl. But you can do it through a dependency service. First in you PCL project declare you service public interface IDbDataFetcher { string GetData(string conn); } Then on you Android project implement the service interface [assembly: … Read more


I just had to deal with the same error message, thrown by DriverManager.getConnection(URL,username,password). I even got the same “magic numbers” (4739923 > 1048576); googling for those “magic numbers” will show results from people also getting the error thrown by some DriverManager.getConnection statement. In my case, the error message about packet size was COMPLETELY MISLEADING; I … Read more

PHP and Microsoft Access database – Connection and CRUD

PDO If you want to interface with an MS Access database using PHP, PDO is available for you. <?php try { $pdo = new PDO(“odbc:Driver={Microsoft Access Driver (*.mdb)};Dbq=C:\accounts.mdb;Uid=Admin”); } catch (PDOException $e) { echo $e->getMessage(); } When using PDO, due to the unified interface for DB operations, you have the opportunity to make your app … Read more

How to use textbox to search data in data grid view?

The likely reason you are seeing a blank DataGridView is due to your filter string searching for exact matches to the TextBox text. “Name=”{0}”” Because you are updating this filter in the TextBox.TextChanged event, the first time you enter a character – no matches are found. For example, given the following grid: ╔════╦══════╗ ╔════════╗ ║ … Read more

Tool for Scripting Table Data

Here are some scripts I wrote for reverse engineering SQL server schemas. They may be of some use. Also, as a general interest they give some examples of how to get various bits of information out of the data dictionary. I’ve added an MIT license below to make permission-to-use explicit and for some basic no-implicit-warranty … Read more

Using reserved words in column names

You can still use key if you want to. Just wrap it with backtick, CREATE TABLE IF NOT EXISTS users ( `key` INT PRIMARY KEY NOT NULL AUTO_INCREMENT, username VARCHAR(50) NOT NULL, ); but as an advise, refrain from using any reserved keyword to avoid future problems. 🙂 MySQL Reserved Keywords List