Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
using System;
using System.Data;
using Pervasive.Data.SqlClient;
using System.IO;
namespace SimpleADONetTest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
try
{
PsqlConnection conn=new PsqlConnection("ServerDSN=demodata;UID=;PWD=;Server=localhost;");
conn.Open();
Console.WriteLine("ServerName: " + conn.ServerName.ToString());
Console.WriteLine("ServerDSN: " + conn.ServerDSN.ToString());
// Create a SQL command
string strSQL = "select * from class";
PsqlCommand DBCmd = new PsqlCommand(strSQL, conn);
PsqlDataReader myDataReader;
myDataReader = DBCmd.ExecuteReader();
Console.WriteLine("FieldCount: " + myDataReader.FieldCount.ToString());
while (myDataReader.Read())
{
for (int i=0;i<myDataReader.FieldCount;i++)
{
Console.WriteLine("Field " + i.ToString() + ": " + myDataReader[i].ToString());
}
}
myDataReader.Close();
conn.Close();
Console.WriteLine("Press Enter to continue");
Console.ReadLine();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadLine();
}
}
}
}