This project is read-only.


Rating: No reviews yet
Downloads: 54
Released: May 26, 2013
Updated: May 26, 2013 by mauro_ghiani
Dev status: Stable Help Icon

Recommended Download

Source Code
source code, 26K, uploaded May 26, 2013 - 54 downloads

Release Notes

Simple SQL Server provider (both SQL SERVER 2005/8/2012 and SQL Compact 4.0).
It abstracts the sql provider layer in order to switch elegantly between the server repository and the local one.


You should call the static load method in order to configure the connection to the repository.


Also it requires some configuration in the app.config or the web.config. First of all the declaration of all the <DbProviderFactories> you want to connect with.

<add key="dataprovider" value="System.Data.SqlClient"/>
<!--<add key="dataprovider" value="System.Data.SqlServerCe.4.0"/>-->

This is an example:

public static List<T> ritornaTop(byte top, bool stato)
List<T> cop = new List<T>();

var sql = "SELECT top(@top) id, titolo, descrizione, img, stato FROM TABLE WHERE stato=@stato order by id DESC ";

var d = new Dictionary<string, dynamic>();
d.Add("stato", stato);
d.Add("top", top);

DataTable table = DataFactory.executeDataTable(sql, d);

for (int i = 0; i < table.Rows.Count; i++)
var row = table.Rows[i];
var cope = new T(); = Convert.ToInt32(row["id"]);
cope.titolo= row["titolo"].ToString();
cope.descrizione = row["descrizione"].ToString();
cope.img = row["img"].ToString();
cope.stato = Convert.ToBoolean(row["stato"]);
return cop;

Reviews for this release

No reviews yet for this release.