0

大家好,我所有的程序员。

我现在尝试了很多方法来连接我从 Spiceworks 获得的 .db 文件。我想制作一个程序,将东西添加到 spiceworks db 文件和同时运行的另一个 sql db。有人对如何做到这一点有任何建议吗?我有点没有想法,我尝试了很多:/ spiceworks_prod.dll 是文件名,是 spiceworks 无法共享文件的名称,有一些我无法共享的信息。

我希望有人能给我一个好的快速解决方案

4

1 回答 1

0

我想出了如何做到这一点我想使用我必须添加到我在此处下载的视觉工作室的SQLite SQLite 主页 从那里开始我只是按照本指南指南设置 SQLite和 woptiedou 它工作我将在下面发布我的解决方案关于我最终是如何做到的。

using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Data.SQLite;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

 namespace Spiceworks_console 
{ 
class DBControl 
{ 
#region SpiceWorks 
SQLiteConnection m_SpiceWorksConnection;

 public bool ConnOpenSpiceWorks() 
{ 
try 
{ 
m_SpiceWorksConnection = new SQLiteConnection("Data Source=C:\\Program Files (x86)\\Spiceworks\\db\\spiceworks_prod.db;Version=3;New=True;");
 m_SpiceWorksConnection.Open(); 

Console.WriteLine("Connected to SpiceWorks DB"); 
return true; 
} 
catch(Exception ex) 
{ 
Console.WriteLine(ex); 
return false; 
} 
}
于 2014-08-11T13:22:50.990 回答