惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Proofpoint News Feed
博客园 - 聂微东
Application and Cybersecurity Blog
Application and Cybersecurity Blog
MyScale Blog
MyScale Blog
罗磊的独立博客
H
Help Net Security
L
LangChain Blog
T
Threat Research - Cisco Blogs
量子位
S
Securelist
Last Week in AI
Last Week in AI
L
Lohrmann on Cybersecurity
T
The Exploit Database - CXSecurity.com
P
Privacy International News Feed
The Hacker News
The Hacker News
Vercel News
Vercel News
D
Darknet – Hacking Tools, Hacker News & Cyber Security
C
Cybersecurity and Infrastructure Security Agency CISA
T
The Blog of Author Tim Ferriss
T
Threatpost
Security Latest
Security Latest
P
Palo Alto Networks Blog
Microsoft Security Blog
Microsoft Security Blog
NISL@THU
NISL@THU
F
Full Disclosure
WordPress大学
WordPress大学
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Heimdal Security Blog
J
Java Code Geeks
Recorded Future
Recorded Future
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
阮一峰的网络日志
阮一峰的网络日志
U
Unit 42
B
Blog RSS Feed
月光博客
月光博客
C
Cisco Blogs
V
Visual Studio Blog
D
DataBreaches.Net
H
Hacker News: Front Page
博客园 - 叶小钗
N
News and Events Feed by Topic
爱范儿
爱范儿
A
Arctic Wolf

博客园 - 天使爱比目鱼

微软日期格式的改变造成程序崩溃 .NET 中DataGridViewComboBoxCell控件得Bug VB.NET在基类中定义共享事件(类似于C#中的静态事件) 也谈解决Combobox绑定数据后取值出现System.Data.DataRowView的问题 在SQL Server 2014下面使用的SQL2000的Northwind和Pubs示例数据库 去除Linq to Sql 查询结果中的空格 VS2015中DataGridView的DataGridViewComBoboxCell列值无效及数据绑定错误的解决方法 DevExpress学习笔记1-ProductsDemo.Win 在VB中使用Linq To SQLite注意事项 在C#中利用Nuget包使用SQLite数据库和Linq to SQLite VB.NET中使用Linq TO SQL添加数据后获得自增长列ID [转载代码]VB.NET 中查询 Linq to SQL 执行时的SQL语句 Linq to SQL 绑定 ComboBox 在VS.NET中根据条件设置不同的MainForm 在T-SQL中使用参数将XML数据添加到SQL数据库的XML列 [转载自键舞者]SELECT IDENT_CURRENT(tableName)获得自增长列ID的实现 测试Windows Live Writer 4步搞定:系统必备的安装位置未设置为组件供应商的网站,无法在磁盘上找到 dotNetFx40LP_Client_x86_x64cs.exe 问题的解决方案 VS2010 SP1 简体中文测试通过,繁体未测试 控件命名规范(转自CSDN)
在VB中利用Nuget包使用SQLite数据库和Linq to SQLite
天使爱比目鱼 · 2013-07-31 · via 博客园 - 天使爱比目鱼

上午解决了在C#中利用Nuget包使用SQLite数据库和Linq to SQLite,但是最后生成的是C#的cs类文件,对于我这熟悉VB而对C#白痴的来说怎么能行呢?

于是下午接着研究,既然生成的是C#的cs类文件,无法直接在VB中使用,那么我们就把生成的cs类文件直接编译成DLL文件,然后在VB中引用,不就行了吗?

1、在VB中执行上面文章中的操作,到第9步,得到cs文件,需要注意的是:在VB中要选择“显示所有文件”才能看到生成的cs类文件:

1

2、双击打开cs文件,复制其中的所有代码。

3、新建一个C#的类库项目:

2

4、将默认的类文件名Class1.cs重命名为在VB中得到的cs文件名:

3

5、将VB中复制的cs文件代码粘贴到刚才重命名的文件中,添加对Linq To SQLite的引用:

4

位置在:56

6、生成DLL文件。

7、在VB项目中添加对C#中生成的DLL文件的引用:

7

8、在VB开始使用Linq To SQLite吧:

Imports DataModel ’对DLL文件的引用 Public Class Form1

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load           
    Dim db As AddressDB            
   db = New AddressDB            
   Dim temp = From cust In db.AddressDistricts                     
                     Select cust

  DataGridView1.DataSource = temp.ToList       
End Sub    

结束:在VB中引用在C#中编译的DLL文件来使用Linq To SQLite,解决了一定的问题,但是也应该看到其中的不便,下一步要努力学习T4模板的使用,实现生成在VB中使用的Linq To SQLite类。