Selman ALPDÜNDAR

How to connect and read data from PostgreSQL in Xamarin

Before starting coding in Xamarin your database must be prepared for connection. First you must grant permission to your user name for database and tables. To grant permission your user name for database please read this  and to grant permission your table please use below in your terminal;

GRANT ALL PRIVILEGES ON TABLE people TO admin; 

Not: do not forget semicolon  if you do not put semicolon your code will not work.

We do not need to do anything in PostgreSQL. Now we can write code in Xamarin let’s start.

Continue with reading

How to create user and grant permission to user in PostgreSQL

For create database use below in your terminal.

CREATE DATABASE test2; 

Not: do not forget semicolon  if you do not put semicolon your code will not work.

For create user name and password use below in your terminal.

CREATE USER test2 WITH PASSWORD '123456';

Not: do not forget semicolon  if you do not put semicolon your code will not work.

For grant permission to user use below in your terminal.

GRANT ALL ON DATABASE test2 TO test2;

Continue with reading