本文介绍了通过编码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
推荐答案
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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!