connection problems with vb.net and sql server

Please support our VB.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 1
Reputation: akosiadrian is an unknown quantity at this point 
Solved Threads: 0
akosiadrian akosiadrian is offline Offline
Newbie Poster

connection problems with vb.net and sql server

 
0
  #1
Jul 10th, 2008
hi guys,

im having problems connecting to my database using vb.net and sql server 2k5. below is the code im currently using and it is having problems. please help me solve this problem. Thanks


adapter.connection = conn is the one having problems
the problem is connection is not a member of system.data.sqlclient.sqldataadapter
  1. Imports System.Data
  2. Imports System.data.SqlClient
  3.  
  4. Public Class search
  5.  
  6. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  7. Dim adapter As New SqlDataAdapter
  8. adapter.Connection = conn
  9. adapter.SelectCommand = New SqlCommand("Select * PPCC_CD.dbo.save_details")
  10. Dim result As DataSet
  11. Try
  12. adapter.Fill(result)
  13. MessageBox.Show(result.Tables(0).Rows(0).Item(0).ToString)
  14.  
  15. Catch ex As Exception
  16. MessageBox.Show("Error: Sql Select statement failed!")
  17. End Try
  18.  
  19.  
  20. End Sub
  21. End Class
Last edited by Narue; Jul 11th, 2008 at 4:12 pm. Reason: Added code tags
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for VB.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC