Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Datagrid binding inconsistencies...............

Reply
Thread Tools

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

 
 
=?Utf-8?B?QUxQTw==?=
Guest
Posts: n/a
 
      11-15-2005
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?







 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      11-15-2005
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?
>
>
>
>
>
>
>

 
Reply With Quote
 
 
 
 
=?Utf-8?B?QUxQTw==?=
Guest
Posts: n/a
 
      11-15-2005
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(prmFY Cd)
SqlDataAdapter1.SelectCommand.Parameters.Add(prmOw nerCd)

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(prmFY Cd)
SqlDataAdapter2.SelectCommand.Parameters.Add(prmLe velCd)
SqlDataAdapter2.SelectCommand.Parameters.Add(prmOw nerCd)

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?
> >
> >
> >
> >
> >
> >
> >

 
Reply With Quote
 
=?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
Guest
Posts: n/a
 
      11-15-2005
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?
>
>
>
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
GridView binding - how to stop initial binding Amit ASP .Net 6 10-24-2006 08:06 AM
pywin32 COM sort in Excel (late binding fails, early binding works) (+py2exe) kogrover@gmail.com Python 2 10-20-2006 04:08 PM
Complex data binding question, binding child objects of a custom collection. JcFx ASP .Net Datagrid Control 0 06-01-2005 04:01 PM
Data Binding - using inline code vs. functions vs. straight binding Jordan ASP .Net 2 02-10-2004 08:32 PM
value binding and function binding Vivek Nallur Ruby 0 09-25-2003 02:52 AM



Advertisments