【问题标题】:How do I edit a .db file like if it was a real database that was running?如何编辑 .db 文件,就像它是正在运行的真实数据库一样?
【发布时间】:2014-08-08 09:52:10
【问题描述】:

你好我所有的程序员。

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

我希望somone可以为我提供一个好的快速解决方案

【问题讨论】:

    标签: database connection connection-string spiceworks


    【解决方案1】:

    我想出了怎么做我想使用我必须添加到我在这里下载的 Visual Studio 中的 SQLite SQLite Homepage 从那时起,我就按照本指南 Guide for setting up SQLite 进行操作,并且 woptiedo 它起作用了,我将在下面发布我的解决方案,说明我最终是如何做到的。

    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; 
    } 
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-22
      • 1970-01-01
      • 2016-03-16
      • 2013-01-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多