SDO_dotNET 1.2.0
dotnet add package SDO_dotNET --version 1.2.0
NuGet\Install-Package SDO_dotNET -Version 1.2.0
<PackageReference Include="SDO_dotNET" Version="1.2.0" />
paket add SDO_dotNET --version 1.2.0
#r "nuget: SDO_dotNET, 1.2.0"
// Install SDO_dotNET as a Cake Addin #addin nuget:?package=SDO_dotNET&version=1.2.0 // Install SDO_dotNET as a Cake Tool #tool nuget:?package=SDO_dotNET&version=1.2.0
private static void TestMySql() { /****************************************************************** * MySQL *******************************************************************/
string server = "localhost";
string database = "DEMODB";
string username = "root";
string password = "";
string connectionString = @"Data Source=" + server + "; Database=" + database + "; User ID=" + username + "; Password=" + password + ";";
//SDO db_conn = new SDO(connectionString);
SDO db_conn = new SDO(new MySqlConnection(connectionString));
Console.WriteLine("IsConnected: " + db_conn.IsConnected());
if (db_conn == null || !db_conn.IsConnected())
{
Console.WriteLine("Connessione non valida.");
Console.ReadLine();
return;
}
string sql;
sql = "SELECT name, surname, email FROM users " +
"ORDER BY name;";
DataTable dtUsers = db_conn.SelectTable(sql);
if (dtUsers == null || dtUsers.Rows.Count == 0)
return;
// Loop with the foreach keyword.
foreach (DataRow dr in dtUsers.Rows)
{
Console.WriteLine("Name: " + dr["name"].ToString().Trim() + " " + dr["surname"].ToString().Trim());
}
}
private static void TestSqlServer() { /****************************************************************** * Sql Server *******************************************************************/
string server = @"INSTANCE\SQLEXPRESS";
string database = "DEMODB";
string username = "sa";
string password = "";
string connectionString = @"Data Source=" + server + ";Initial Catalog=" + database + "; Trusted_Connection=True;User ID=" + username + ";Password=" + password + ";Connect Timeout=60";
//SDO db_conn = new SDO(connectionString);
SDO db_conn = new SDO(new SqlConnection(connectionString));
Console.WriteLine("IsConnected: " + db_conn.IsConnected());
if (db_conn == null || !db_conn.IsConnected())
{
Console.WriteLine("Connessione non valida.");
Console.ReadLine();
return;
}
string sql = "SELECT TOP 10 ID, Message FROM Log4NetLog ORDER BY IDLic;";
DataTable dtLogs = db_conn.SelectTable(sql);
if (dtLogs == null || dtLogs.Rows.Count == 0)
return;
// Loop with the foreach keyword.
foreach (DataRow dr in dtLogs.Rows)
{
Console.WriteLine("Message: " + dr["Message"].ToString().Trim());
}
}
private static void TestSQLite() { /****************************************************************** * SQLite *******************************************************************/
string database = @"C:\Users\Utente\mydb.sqlite";
string connectionString = @"Data Source=" + database + "; Version=3; New=True; Compress=True;"; // local
SDO db_conn = new SDO(connectionString);
Console.WriteLine("IsConnected: " + db_conn.IsConnected());
if (db_conn == null || !db_conn.IsConnected())
{
Console.WriteLine("Connessione non valida.");
Console.ReadLine();
return;
}
string sql = "SELECT firstname, surname FROM users ORDER BY firstname;";
DataTable dtLogs = db_conn.SelectTable(sql);
if (dtLogs == null || dtLogs.Rows.Count == 0)
return;
// Loop with the foreach keyword.
foreach (DataRow dr in dtLogs.Rows)
{
Console.WriteLine("Name: " + dr["firstname"].ToString().Trim() + " " + dr["surname"].ToString().Trim());
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net40 is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- MySql.Data (>= 8.0.21)
- System.Data.SQLite.Core (>= 1.0.113.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
SQL Data Object .NetFramework.