Datagrid binding inconsistencies...............

Discussion in 'ASP .Net' started by =?Utf-8?B?QUxQTw==?=, Nov 15, 2005.

  1. In a web application we have a page that has two data grids (dg1 & dg2), 2
    dataadpaters (da1 & da2), and 2 datasets (ds1 & ds2). The dataadpaters and
    datasets were created by dragging and dropping the objects from the data
    toolbar.

    dg1 is bound to ds1 through da1
    dg2 is bound to ds2 through da2

    When operating properly the page should work as follows the two grids show
    the data correctly. However, sporadically, both datasets appear in dg2.
    Confusing?

    Has anyone ever seen anything like this?
    =?Utf-8?B?QUxQTw==?=, Nov 15, 2005
    #1
    1. Advertising

  2. There is no reason for this to happen except that you might have accidently
    mixed up the dataadapters' binding. If you post the code that you use, one
    might be able to help.
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "ALPO" wrote:

    > In a web application we have a page that has two data grids (dg1 & dg2), 2
    > dataadpaters (da1 & da2), and 2 datasets (ds1 & ds2). The dataadpaters and
    > datasets were created by dragging and dropping the objects from the data
    > toolbar.
    >
    > dg1 is bound to ds1 through da1
    > dg2 is bound to ds2 through da2
    >
    > When operating properly the page should work as follows the two grids show
    > the data correctly. However, sporadically, both datasets appear in dg2.
    > Confusing?
    >
    > Has anyone ever seen anything like this?
    >
    >
    >
    >
    >
    >
    >
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Nov 15, 2005
    #2
    1. Advertising

  3. OK, here is the code:

    Try

    prmFYCd.Value = Me.dlstFiscalYear.SelectedValue
    prmOwnerCd.Value = Session("strSessionUserId")

    prmLevelCd.Value = Me.rlstTaskLevel.SelectedValue

    ' Populate the budgeted data adapter and bind it to the datagrid.
    ' DataAdapter1 has data source spGetBudgetedSPs.
    'spGetBudgetedSPs need FY and Owner.

    SqlDataAdapter1.SelectCommand.Connection = conCnn
    SqlDataAdapter1.SelectCommand.Parameters.Add(prmFYCd)
    SqlDataAdapter1.SelectCommand.Parameters.Add(prmOwnerCd)

    SqlDataAdapter1.SelectCommand().CommandTimeout =
    cnstCommandTimeout
    SqlDataAdapter1.Fill(GetBudgeted2)
    DataBind()

    ' Clear parameters.

    SqlDataAdapter1.SelectCommand.Parameters.Clear()

    ' DataAdapter2 has data source spGetNonBudgetedSPs.
    'spGetNonBudgetedSPs need FY and TaskLevel.

    SqlDataAdapter2.SelectCommand.Connection = conCnn
    SqlDataAdapter2.SelectCommand.Parameters.Add(prmFYCd)
    SqlDataAdapter2.SelectCommand.Parameters.Add(prmLevelCd)
    SqlDataAdapter2.SelectCommand.Parameters.Add(prmOwnerCd)

    SqlDataAdapter2.SelectCommand().CommandTimeout =
    cnstCommandTimeout
    SqlDataAdapter2.Fill(GetNonBudgeted2)
    DataBind()


    "Phillip Williams" wrote:

    > There is no reason for this to happen except that you might have accidently
    > mixed up the dataadapters' binding. If you post the code that you use, one
    > might be able to help.
    > --
    > HTH,
    > Phillip Williams
    > http://www.societopia.net
    > http://www.webswapp.com
    >
    >
    > "ALPO" wrote:
    >
    > > In a web application we have a page that has two data grids (dg1 & dg2), 2
    > > dataadpaters (da1 & da2), and 2 datasets (ds1 & ds2). The dataadpaters and
    > > datasets were created by dragging and dropping the objects from the data
    > > toolbar.
    > >
    > > dg1 is bound to ds1 through da1
    > > dg2 is bound to ds2 through da2
    > >
    > > When operating properly the page should work as follows the two grids show
    > > the data correctly. However, sporadically, both datasets appear in dg2.
    > > Confusing?
    > >
    > > Has anyone ever seen anything like this?
    > >
    > >
    > >
    > >
    > >
    > >
    > >
    =?Utf-8?B?QUxQTw==?=, Nov 15, 2005
    #3
  4. The code segment you posted looks OK. What do you have in DataBind()?
    --
    HTH,
    Phillip Williams
    http://www.societopia.net
    http://www.webswapp.com


    "ALPO" wrote:

    > In a web application we have a page that has two data grids (dg1 & dg2), 2
    > dataadpaters (da1 & da2), and 2 datasets (ds1 & ds2). The dataadpaters and
    > datasets were created by dragging and dropping the objects from the data
    > toolbar.
    >
    > dg1 is bound to ds1 through da1
    > dg2 is bound to ds2 through da2
    >
    > When operating properly the page should work as follows the two grids show
    > the data correctly. However, sporadically, both datasets appear in dg2.
    > Confusing?
    >
    > Has anyone ever seen anything like this?
    >
    >
    >
    >
    >
    >
    >
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=, Nov 15, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?QUxQTw==?=

    Datagrid bind inconsistencies.......

    =?Utf-8?B?QUxQTw==?=, Nov 14, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    338
    Eliyahu Goldin
    Nov 15, 2005
  2. Anand S Bisen
    Replies:
    2
    Views:
    2,213
    Steve Holden
    Mar 4, 2005
  3. Darren Dale

    python style guide inconsistencies

    Darren Dale, Apr 22, 2007, in forum: Python
    Replies:
    8
    Views:
    334
    Terry Reedy
    Apr 23, 2007
  4. Rui Maciel

    swprintf declaration inconsistencies?

    Rui Maciel, Jul 3, 2007, in forum: C Programming
    Replies:
    3
    Views:
    402
    Rui Maciel
    Jul 3, 2007
  5. John Hanley

    inconsistencies with mktime()

    John Hanley, Sep 8, 2007, in forum: C Programming
    Replies:
    2
    Views:
    892
    John Hanley
    Sep 8, 2007
Loading...

Share This Page