954,515 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

connection problems with vb.net and sql server

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

Imports System.Data
Imports System.data.SqlClient

Public Class search

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim adapter As New SqlDataAdapter
        adapter.Connection = conn
        adapter.SelectCommand = New SqlCommand("Select * PPCC_CD.dbo.save_details")
        Dim result As DataSet
        Try
            adapter.Fill(result)
            MessageBox.Show(result.Tables(0).Rows(0).Item(0).ToString)

        Catch ex As Exception
            MessageBox.Show("Error: Sql Select statement failed!")
        End Try


    End Sub
End Class
akosiadrian
Newbie Poster
1 post since Jul 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You