VB.net,Pervasive SQL连接 [英] VB.net, Pervasive SQL connection

查看:109
本文介绍了VB.net,Pervasive SQL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我只需要知道如何在我的VB.net项目和普及SQL之间建立连接。

Hello,
I just need to know how can I establish a connection between my VB.net Project and pervasive SQL.

推荐答案

您好,



您可以从此处 [ ^ ]。 此处 [ ^ ]是Pervasive ADO.NET提供程序文档的链接。以下是连接Pervasive db的示例代码,

Hello,

You can use ADO.NET Provider for Pervasive available from here[^]. Here[^] is a link for Pervasive ADO.NET provider documentation. Here is a sample code to connect to Pervasive db,
Imports System.Data;
Imports System.Data.Common;
Imports Pervasive.Data.SqlClient;

Public Class TestDB
     Public Sub TestDB()
         DIm dbCon As PsqlConnection

         dbCon = new PsqlConnection("Server DSN=DEMODATA;Host=localhost") 
         Try
             dbCon.Open()
             Console.WriteLine("Connection Successful!")
         Catch ex As PsqlException
             Console.WriteLine("Failed to Connect")
         Finally
            dbCon.Close()
         End Try 
     End Sub
End Class



问候,


Regards,


这篇关于VB.net,Pervasive SQL连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆