2012-11-20 09:51:51
public static DataTable GetDataTable (string sql)
 
   {
 
    DataTable dt = new DataTable();
 
    try
 
    {
 
    SQLiteConnection cnn = new SQLiteConnection("Data Source=C:CheckoutWorldDominator.s3db");
 
    cnn.Open();
 
    SQLiteCommand mycommand = new SQLiteCommand(cnn);
 
    mycommand.CommandText = sql;
 
    SQLiteDataReader reader = mycommand.ExecuteReader();
 
    dt.Load(reader);
 
    reader.Close();
 
    cnn.Close();
 
    } catch {
 
    // Catching exceptions is for communists
 
    }
 
    return dt;
 
 
}
 
public static int ExecuteNonQuery(string sql)
 
{
 
    SQLiteConnection cnn = new SQLiteConnection("Data Source=C:CheckoutWorldDominator.s3db");
 
    cnn.Open();
 
    SQLiteCommand mycommand = new SQLiteCommand(cnn);
 
    mycommand.CommandText = sql;
 
    int rowsUpdated = mycommand.ExecuteNonQuery();
 
    cnn.Close();
 
    return rowsUpdated;
 
}
 
public static string ExecuteScalar(string sql)
 
{
 
    SQLiteConnection cnn = new SQLiteConnection("Data Source=C:CheckoutWorldDominator.s3db");
 
    cnn.Open();
 
    SQLiteCommand mycommand = new SQLiteCommand(cnn);
 
    mycommand.CommandText = sql;
 
    object value = mycommand.ExecuteScalar();
 
    cnn.Close();
 
if (value != null)
 
    {
 
        return value.ToString();
 
    }
 
    return "";
 
}
Invalid Email or Password