problem with sql statment

May 11 2005 2:08 PM
hellow to all i am new to vb.net and i am working with data base i try to run the next code Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim sql As String sql = "select Customer.Customer from Customer Where Customer.Customer ID = 1" Dim objconn As New OleDb.OleDbConnection(sConnection) Dim objdataadapter As New OleDb.OleDbDataAdapter(sql, objconn) Dim objds As New DataSet("Customer") Dim objdv As DataView Dim objtabel As DataTable Try objconn.Open() Catch ex As Exception Windows.Forms.MessageBox.Show(ex.Message) End Try If objconn.State = ConnectionState.Open Then Try objdataadapter.Fill(objds, "Customer") objconn.Close() objtabel = objds.Tables("Customer") objdv = objtabel.DefaultView TextBox2.DataBindings.Add("text", objdv, "Customer") Catch ex As Exception Windows.Forms.MessageBox.Show(ex.Message) End Try End If End Sub and when i run it i get a wrong message .. i had cheaked the database i have all the tabels and the customer ID thxx for the help

Answers (6)