Results 1 to 7 of 7

Thread: [RESOLVED] [2005] DataGridView Binding

Threaded View

  1. #1

    Thread Starter
    Frenzied Member circuits2's Avatar
    Join Date
    Sep 2006
    Location
    Kansas City, MO
    Posts
    1,027

    Resolved [RESOLVED] [2005] DataGridView Binding

    I'm having a major brainfart today and can't think straight.

    I'm binding my DataGridView to a BindingSource, and then binding the BindingSource to a DataTable like this:

    Code:
    Private Sub(ByVal part As String)
    
         ' SET CONNECTION STRING
         Me.PartReqsCon.ConnectionString = DataBaseTools.GetConnectionString("PartReqs")
    
         ' SET COMMAND STRING
         Dim cmdString As String = "SELECT * FROM PartReqs_tbl WHERE PartKey = " & part
    
         ' RENEW DATA ADAPTER
         Me.ReqsDataAdapter = New OleDbDataAdapter
         Me.ReqsDataAdapter.SelectCommand = New OleDbCommand(cmdString, Me.PartReqsCon)
    
         ' CREATE COMMAND BUILDER FOR DATA ADAPTER
         Dim commandBuilder As New OleDbCommandBuilder(Me.ReqsDataAdapter)
    
         ' CREATE DATA TABLE AND SET LOCALE
         Dim table As New DataTable()
         table.Locale = System.Globalization.CultureInfo.InvariantCulture
    
         ' FILL DATA TABLE
         Me.ReqsDataAdapter.Fill(table)
    
         ' BIND DATA TABLE
         Me.ReqsBindingSource.DataSource = table
    
         ' DATAGRIDVIEW IS BOUND FROM DESIGNER
    
    End Sub
    I'm getting an error on the Fill method:

    "No value given for one or more required parameters."


    I created a breakpoint and it looks like all of the requirements are there. What am I missing?
    Last edited by circuits2; Jun 20th, 2007 at 10:07 AM.
    Show the love! Click (rate this post) under my name if I was helpful.

    My CodeBank Submissions: How to create a User Control | Move a form between Multiple Monitors (Screens) | Remove the MDI Client Border | Using Report Viewer with Visual Studio 2012 Express

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width