Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / March 2008

Tip: Looking for answers? Try searching our database.

ObjectDataSource Binding Before I Need it

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Wilson - 28 Mar 2008 22:17 GMT
I have a gridview that is using an objectdatasource that is calling a
BLL class that wraps a Typed dataset.  The objectdatasource has
parameters that tied to page controls (textboxes, dropdowns ect)  I
had always thought that the Objectdatasource wouldn't bind while the
gridview's visible property was set to false, but I'm experiencing
timeouts when the page is initially loaded  when the objectdatasource
tries to bind without the necessary user input to filter down the
results and before I make the gridview visible.

Can anyone suggest a way to prevent the objectdatasource from binding
untl the user has filled in the form?

Thanks,

Jason
Just Me - 28 Mar 2008 22:19 GMT
I doubt if the visibility is the issue, but you could easily test this by
making it visible.

>I have a gridview that is using an objectdatasource that is calling a
> BLL class that wraps a Typed dataset.  The objectdatasource has
[quoted text clipped - 11 lines]
>
> Jason
Jason Wilson - 28 Mar 2008 22:52 GMT
I'm not sure what you mean.  I was saying that I tried to prevent the
premature binding of the objectdatasource by making the gridview not
visible.  I was mistaken that would do the trick.  So now I am trying
to find another way to prevent the ods from binding before the form is
filled out.
Just Me - 29 Mar 2008 01:19 GMT
Ahh, ok. What sort of timeouts, are these SQL timeouts ? Can you get an
exception message ?
where exactly is this failing.

If its breaking at a particular line, you should be able to get more
information

> I'm not sure what you mean.  I was saying that I tried to prevent the
> premature binding of the objectdatasource by making the gridview not
> visible.  I was mistaken that would do the trick.  So now I am trying
> to find another way to prevent the ods from binding before the form is
> filled out.
Stan - 29 Mar 2008 11:29 GMT
> I have a gridview that is using an objectdatasource that is calling a
> BLL class that wraps a Typed dataset.  The objectdatasource has
[quoted text clipped - 11 lines]
>
> Jason

Dear Jason

When binding the ObjectDataSource to the GridView with the
DataSourceID property you have no control over when the binding
occurs.

If there are problems because of (intially) null parameter values then
set the "DefaultValue" property of each parameter to something
meaningful (DefaultValue is used when the actual parameter source - in
this case a web server control - has null content).

HTH
Stan - 29 Mar 2008 11:42 GMT
> > I have a gridview that is using an objectdatasource that is calling a
> > BLL class that wraps a Typed dataset.  The objectdatasource has
[quoted text clipped - 24 lines]
>
> HTH

Oops, slight correction

When binding the ObjectDataSource (or any other type of DataSource
control) with the DataSourceID property of controls like GridView,
FormView etc, then you have no control over when the *automatic* data
binding occurs.

You can however force it to occur manually with the DataBind() method.
This will cause the data binding to occur in addition to when it
happens automatically.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.