Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. data binding update problem

data binding update problem

Scheduled Pinned Locked Moved Visual Basic
helpwpfwcfgraphicsannouncement
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    asha_s
    wrote on last edited by
    #1

    hi i am using data binding and this is my code Imports System.Drawing.Printing Public Class Form2 Public ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source =" & Application.StartupPath & "\ITDSS.mdb" Public con As New OleDbConnection(ConStr) Dim DataSet1, course As New DataSet 'Dim SQLstr = "SELECT SectionID,Type,Group,TeacherID from [Section]" Dim SQLstr = "SELECT DISTINCT s.LevelNo, c.CourseID,c.SectionID,c.Type,c.Group, r.RoomID FROM [Section] c,Course s,[Slot] r where s.CourseID=c.CourseID and c.SectionID=r.SectionID ORDER BY s.LevelNo" ' in(select CourseID from Course Where LevelNo=1)" 's,Course c WHERE s.CourseID = c.CourseID ORDER BY c.LevelNo" Dim DataAdapter1 As New OleDb.OleDbDataAdapter(SQLstr, con) '----------------------=============================== Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim SQLstr, SQLstr1 As String 'Dim DataSet1, course As New DataSet 'SQLstr = "SELECT SectionID,Type,Group from [Section]" Con.Open() 'DataAdapter1 = New OleDb.OleDbDataAdapter(SQLstr, con) DataAdapter1.Fill(DataSet1, "Section") Me.DataBindings.Add("text", DataSet1, "Section.SectionID") DataGridView1.DataSource = DataSet1 DataGridView1.DataMember = "Section" Dim bmb As BindingManagerBase bmb = Me.BindingContext(DataSet1, "Section") bmb.Position = bmb.Count bmb.Position = 0 end sub and i want to update it when button press i but the flowing code Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim CmdB As New OleDb.OleDbCommandBuilder(DataAdapter1) DataAdapter1.Update(DataSet1, "Section") End Sub End Class but it give error update statement please i need help :(( :zzz:

    M 1 Reply Last reply
    0
    • A asha_s

      hi i am using data binding and this is my code Imports System.Drawing.Printing Public Class Form2 Public ConStr As String = "Provider=Microsoft.Jet.OLEDB.4.0;" & _ "Data Source =" & Application.StartupPath & "\ITDSS.mdb" Public con As New OleDbConnection(ConStr) Dim DataSet1, course As New DataSet 'Dim SQLstr = "SELECT SectionID,Type,Group,TeacherID from [Section]" Dim SQLstr = "SELECT DISTINCT s.LevelNo, c.CourseID,c.SectionID,c.Type,c.Group, r.RoomID FROM [Section] c,Course s,[Slot] r where s.CourseID=c.CourseID and c.SectionID=r.SectionID ORDER BY s.LevelNo" ' in(select CourseID from Course Where LevelNo=1)" 's,Course c WHERE s.CourseID = c.CourseID ORDER BY c.LevelNo" Dim DataAdapter1 As New OleDb.OleDbDataAdapter(SQLstr, con) '----------------------=============================== Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim SQLstr, SQLstr1 As String 'Dim DataSet1, course As New DataSet 'SQLstr = "SELECT SectionID,Type,Group from [Section]" Con.Open() 'DataAdapter1 = New OleDb.OleDbDataAdapter(SQLstr, con) DataAdapter1.Fill(DataSet1, "Section") Me.DataBindings.Add("text", DataSet1, "Section.SectionID") DataGridView1.DataSource = DataSet1 DataGridView1.DataMember = "Section" Dim bmb As BindingManagerBase bmb = Me.BindingContext(DataSet1, "Section") bmb.Position = bmb.Count bmb.Position = 0 end sub and i want to update it when button press i but the flowing code Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim CmdB As New OleDb.OleDbCommandBuilder(DataAdapter1) DataAdapter1.Update(DataSet1, "Section") End Sub End Class but it give error update statement please i need help :(( :zzz:

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Um where is your update script!, I can see your select but no update

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups