Communicating with IBM i system from PC can be done in various way, one of them is using .net data provider. IBM provides .net data provider to connect to i series. This article explains how you can connect to iseries using .net dataprovider from IBM.
You'll need to install .net dataprovider in your system, you can find it from IBM website.
After installing .net dataprovider you'll be able to see following component in your reference list in Visual Studio (this is for V6R1, V5R4 just says IBM dataprovider).
Now you add this reference in your project and you are ready to code.
const string connectionstring = "Data Source=192.168.0.100;User ID=MYUSERID;Password=MYPASSWD";
using (var connection = new iDB2Connection(connectionstring))
using(var dataAdapter = new iDB2DataAdapter("select * from LIBRARYNAME.TABLENAME",connection))
var dataTable = new DataTable();
foreach (DataRow row in dataTable.Rows)