請問SQL連線問題...

看板Programming作者時間18年前 (2006/06/17 11:32), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
我寫一個VB.net連線到SQL 2000 用查詢方式輸入 以lable顯示各相對欄位.... 可是我都會出現下面錯誤 我該怎嚜去設定?? http://tw.myblog.yahoo.com/jw!ZdnkH7acGRwOpSJFzUTR0ju0/photo?pid=9 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim cn As New SqlConnection("server=192.111.0.2.;database=test;uid=doctor;pwd=123;") Dim cmd As New SqlCommand("select * from person where id='" & TextBox1.Text & "'", cn) Try cn.Open() Dim dr As SqlDataReader = cmd.ExecuteReader(CommandBehavior.CloseConnection) dr.Read() Label1.Text = dr("CategoryID") Label2.Text = dr("CategoryName") Label3.Text = dr("Description") Catch ex As SqlException MessageBox.Show(ex.Message) End Try End Sub -- ┌─────KKCITY─────┐─┐KKADSL六星級優質連線服務 bbs.kkcity.com.tw └─ 馬上申請帶你上網環遊全世界! └──From:140.115.70.87 ──┘ KKADSL http://adsl.kkcity.com.tw --
文章代碼(AID): #14atUp00 (Programming)
討論串 (同標題文章)
文章代碼(AID): #14atUp00 (Programming)