Results 1 to 3 of 3

Thread: [RESOLVED] Fil TableAdapter using a parameter shows no data

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2020
    Posts
    3

    Resolved [RESOLVED] Fil TableAdapter using a parameter shows no data

    Hi,

    I have two related tables. 1 table contains books and the other table contains the libraries that own the books. Now I only want to see 1 library with the books. There is a variable called IDGemeente. It is defined as integer. Now I want to fill the Tableadapter with the data using a FillBy query The query is defined like this:

    Name:  QB.jpg
Views: 182
Size:  26.8 KB

    When I run the program and fill in the parameter, nothing shows up. No error / no data

    Code:
    Me.BoekenGemeentenTableAdapter.FillBy(Me.BoekenBewVerwDataSet.BoekenGemeenten, New System.Nullable(Of Integer)(CType(Param1ToolStripTextBox.Text, Integer)))
    Name:  RT.jpg
Views: 142
Size:  15.1 KB

    Am I doing something wrong?

    Kind regards,
    Dante

  2. #2
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Re: Fil TableAdapter using a parameter shows no data

    Code:
    Me.BoekenGemeentenTableAdapter.FillBy(Me.BoekenBewVerwDataSet.BoekenGemeenten, New System.Nullable(Of Integer)(CType(Param1ToolStripTextBox.Text, Integer)))
    To be honest I don't understand, " New System.Nullable(Of Integer)(CType(Param1ToolStripTextBox.Text, Integer))", maybe it's fine I don't know. But there is no need for it,

    Code:
    Me.BoekenGemeentenTableAdapter.FillBy(Me.BoekenBewVerwDataSet.BoekenGemeenten, CInt(Param1ToolStripTextBox.Text))
    That how I would do it, if it still doesn't work then simplify it even more,

    Code:
    Me.BoekenGemeentenTableAdapter.FillBy(Me.BoekenBewVerwDataSet.BoekenGemeenten, 1)
    You can check if any rows are returned by the FillBy method


    Code:
    Dim var as Integer = Me.BoekenGemeentenTableAdapter.FillBy(Me.BoekenBewVerwDataSet.BoekenGemeenten, 1)
    Last edited by wes4dbt; Dec 19th, 2020 at 09:42 PM.

  3. #3
    PowerPoster
    Join Date
    Sep 2005
    Location
    Modesto, Ca.
    Posts
    5,195

    Re: Fil TableAdapter using a parameter shows no data

    dup post

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