Project Description
jccc .NET smart framework allows the creation of fast connections to MSSQL or MYSQL databases, and the data manipulation by using of c# class's that represents the SQL tables in the databases.

Usage:
STEP 1: MSSQL Database
create table testes(
id_teste int identity primary key not null,
campoteste1 varchar(200) not null,
campoteste2 decimal(10,2) not null,
campoteste3 datetime not null,
activa bit not null
);

STEP 2: C# class using the same notation as the MSSQL Database
public class testes
{
public int id_teste;
public string campoteste1;
public decimal campoteste2;
public DateTime campoteste3;
public bool activa;
}

STEP 3: Define the connection string Web.config or App.config

<configuration>
<connectionStrings>
<add name="conn"
connectionString="Data Source=localhost\sqlexpress;Initial Catalog=dbtestes;User Id=dbtestesuser;Password=dbtestes_pass;"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>

Final STEP: use the framework

jccc.bd db1 = new jccc.bd();
Console.Out.WriteLine("{0}", db1.executar_s("SELECT count(*) FROM testes;"));
testes t1 = new testes();
t1.id_teste= 0;
t1.campoteste1 = "test";
t1.campoteste2 = 10;
t1.campoteste3 = DateTime.Now;
t1.activa = true;

Console.Out.WriteLine("Insert {0}", db1.smart_insert(t1));
t1.campoteste1 = "test1";
Console.Out.WriteLine("Update {0}", db1.smart_update(t1));
Console.Out.WriteLine("Select {0}", db1.smart_select(t1));
Console.Out.WriteLine("Delete {0}", db1.smart_delete(t1));



More information at: http://www.joelcorreia.pt/?p=26

Last edited Apr 26, 2012 at 2:57 PM by joelcorreia, version 12