(急)sql连接的问题,大家来帮忙@!
我得.net链接局域网里得另一个机器得数据库,在企业管理器十可以链接和访问得,但十在程序里面就访问不了,总是链接超时,请问是什么原因啊!
------解决方案--------------------程序里面还是有错误,把代码贴一下才可以。
.net连接数据库,引用
<%@ Import Namespace= "System.Data " %>
<%@ Import NameSpace= "System.Data.SqlClient " %>
<script laguage= "VB " runat= "server ">
sub page_load(sender as Object,e as EventArgs)
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
Dim ds as DataSet
'1.connect to sql server
myConnection = New SqlConnection( "server=localhost;database=Pubs;uid=ueytjdf;pwd=doekdf " )
myConnection.Open()
la1.text= "Connection Opened! "