通过编码vb.net将sql客户端加入sql server [英] Join sql client to sql server by coding vb.net

查看:87
本文介绍了通过编码vb.net将sql客户端加入sql server的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将SQL Client(另一台PC)与SQL Server联系以获取访问数据,你可以通过编写VB.NET来帮助我吗?



我尝试了什么:



我无法通过服务器资源管理器和编码浏览。

我不知道问题

I would like to joint SQL Client(another PC) to SQL Server for access data, Can u help me by coding VB.NET?

What I have tried:

I can't browse by Server Explorer and Coding.
I don't know problem

推荐答案

很难说出你的问题是什么。



假设(如果我是正确的话)你想从VB项目访问SQL服务器上的数据吗?



非常原始的例子:



Hard to tell what your problem is from this.

Assuming (correct me if I am wrong) you would like to access data on an SQL server from a VB project?

Very primitive example:

Import System.Data.SqlClient 


Sub AccessDatabase

   Dim oSQLConnection As New SqlConnection
   Dim oSQLCommand As SqlCommand
   Dim oSQLDataReader As SqlDataReader

   oSQLConnection = New SqlConnection("Initial Catalog=Database; _
                         User ID=UserID ;Data Source=ServerName;Password=Password)
   oSQLConnection.Open()

   oSQLCommand = New SqlCommand("SELECT * FROM table", oSQLConnection)
   oSQLDataReader = oSQLCommand.ExecuteReader

   etc...

End Sub





希望这会有所帮助,但请提供更多信息,如果这不是你需要知道的。



Hope this helps but please provide more information if this is not what you needed to know.


这篇关于通过编码vb.net将sql客户端加入sql server的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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