Skip to content

Instantly share code, notes, and snippets.

@cofearabi
cofearabi / cs_access
Created December 15, 2012 09:10
(C#) display the value of field of the table in access mdb.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
@cofearabi
cofearabi / gist:4301879
Created December 16, 2012 01:17
(C#) connect to the access database and display values of fields.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.OleDb;
using System.Data;
using System.Xml.Serialization;
namespace ConsoleApplication2
@cofearabi
cofearabi / gist:4333269
Created December 19, 2012 00:04
(C#) read and write the value of A1 cell of Excel sheet
using System;
using Microsoft.Office.Interop.Excel;
namespace COMAutomation_Excel_CS
{
class Program
{
static void Main(string[] args)
{
string fileName = @"C:\mdb\temp2.xlsx";
@cofearabi
cofearabi / gist:4339565
Created December 19, 2012 19:12
(C#) display the chart extracting from Access mdb database of stock data
private void display_chart(int code , int miniY)
{
chart1.ChartAreas[0].AxisY.Minimum = miniY;
String meigara = code.ToString();
// Resolve the address to the Access database
@cofearabi
cofearabi / gist:4339944
Created December 19, 2012 19:58
(C#) read a csv text file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.VisualBasic.FileIO;
namespace cs_read_csv
{
class Program
@cofearabi
cofearabi / gist:4365075
Created December 23, 2012 18:26
(Perl) connect the Access mdb and display fields of the table.
#!/usr/local/bin/perl
use Win32::OLE;
$conn = "Provider=Microsoft.Jet.OLEDB.4.0;";
$conn .= "Data Source=c:\\mdb\\addressbook_2007.mdb;";
$db = Win32::OLE->new("ADODB.Connection");
$db->Open($conn);
@cofearabi
cofearabi / gist:4399232
Created December 28, 2012 16:12
(C#) make a chart from excel data
private void Form1_Load(object sender, EventArgs e)
{
// The Excel file name
string fileNameString = "\\temp.xls";
// Create connection object by using the preceding connection string.
string sConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" +
fileNameString + ";Extended Properties=\"Excel 8.0;HDR=YES\"";
OleDbConnection myConnection = new OleDbConnection( sConn );
@cofearabi
cofearabi / gist:4443524
Last active June 15, 2016 15:40
(C#) diaplay a chart from csv data
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Windows.Forms.DataVisualization.Charting;
using System.Data.OleDb;
@cofearabi
cofearabi / gist:4604511
Created January 23, 2013 11:13
(Java) Read CSV
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
public class ReadCSV {
@cofearabi
cofearabi / access_dsnless
Last active December 11, 2015 15:38
(Java) connect to a access mdb database without dsn
import java.sql.*;
public class password {
public static void main(String[] args) {
try{
//
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//