Alguien q me ayude xfis lo q pasa es q deseaba hacer una aplicacion con la base de datos Pubs q viene en acces 2003 con la tabla Jobs y al tratar de ejecutar me sale un error y no se q puede ser alguien sabe pues aki les de jo el codigo y unas imagenes ojala me puedan ayudar ya q soy noob y x mas q releeo no encuentro el problema
Public Class Form1
Inherits System.Windows.Forms.Form
Dim dt As New DataTable
Dim dv As New DataView
Dim strcon As String = "database=Pubs;user id=sa"
Dim strsql As String = "select * from jobs"
Dim da As New SqlDataAdapter(strsql, strcon)
Dim cb As New SqlCommandBuilder(da)
Dim i As Integer
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
da.Fill(dt)
dt.TableName = "Empleos"
dv.Table = dt
DataGrid1.DataSource = dv
da.InsertCommand = cb.GetInsertCommand
da.DeleteCommand = cb.GetDeleteCommand
da.UpdateCommand = cb.GetUpdateCommand
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dr As DataRow = dt.NewRow
dr("job_id") = txtjobid.Text
dr("job_desc") = txtjobdesc.Text
dr("min_lvl") = txtmin.Text
dr("max_lvl") = txtmax.Text
dt.Rows.Add(dr)
da.Update(dt)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim r As Integer
For r = 0 To dt.Rows.Count - 1
If UCase(dt.Rows(r).Item("job_id")) = UCase(txtjobid.Text) Then
dt.Rows(r).Delete()
da.Update(dt)
Exit Sub
End If
Next
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim r As Integer
For r = 0 To dt.Rows.Count - 1
If UCase(dt.Rows(r).Item("job_id")) = UCase(txtjobid.Text) Then
dt.Rows(r).BeginEdit()
dt.Rows(r).Item("job_desc") = txtjobdesc.Text
dt.Rows(r).Item("min_lvl") = txtmin.Text
dt.Rows(r).Item("max_lvl") = txtmax.Text
dt.Rows(r).EndEdit()
da.Update(dt)
Exit Sub
End If
Next
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
dv.RowFilter = "job_id='" & txtjobid.Text & "'"
txtjobdesc.Text = dv.Item(0).Item("job_desc")
txtmin.Text = dv.Item(0).Item("min_lvl")
txtmax.Text = dv.Item(0).Item("max_lvl")
End Sub
End Class