473,289 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

ObjectDataSource question??

How could i pass a parmeter to objectDataSource..

objectDataSource1.UpdateParameters["ID"]
don't have "Value" Property, How could i set parameters value at runtime??
May 17 '06 #1
1 2288
On Wed, 17 May 2006 19:52:01 +0300, "Islamegy®" <Is******@Private.4me>
wrote:
How could i pass a parmeter to objectDataSource..

objectDataSource1.UpdateParameters["ID"]
don't have "Value" Property, How could i set parameters value at runtime??


Just add DefaultValue. Here is an example using my Membership
ObjectDataSource. I'm a little amazed that "true" actually works.
Kind of Rubyesque.

protected void Button1_Click(object sender, EventArgs e)
{

//<UpdateParameters>
// <asp:Parameter Name="UserName" Type="String" />
// <asp:Parameter Name="isApproved" Type="Boolean" />
// </UpdateParameters>

ObjectDataSource1.UpdateParameters["UserName"].DefaultValue =
"pkellner";
ObjectDataSource1.UpdateParameters["isApproved"].DefaultValue
= "true";
int updated = ObjectDataSource1.Update();
GridView1.DataBind();
}
Peter Kellner
http://peterkellner.net
May 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kristof Van Praet | last post by:
Hello all, The ObjectDataSource control uses reflection to create instances of business components and call the appropriate methods to select, update,... data. How can I use the...
5
by: Ole M | last post by:
I'm having some trouble using the ObjectDataSource in ASP.NET 2.0. I have a wrapper that contains the static methods for Select and Update. The Update-method takes the business object as...
3
by: avezina | last post by:
We would like to use those new cool features of Asp.Net 2.0 like the ObjectDataSource in our project. I tried few basics examples and its work well. Let's say I have a page that displays a...
2
by: planetthoughtful | last post by:
Hi All, I have an ASP.NET page that displays a GridView control based on an ObjectDataSource control. I'm wondering if it's possible to base the ObjectDataSource in question on a parameter...
14
by: Rolf Welskes | last post by:
Hello, I have an ObjectDataSource which has as business-object a simple array of strings. No problem. I have an own (custom) control to which I give the DataSourceId and in the custom-control...
3
by: Doug Salomon | last post by:
Hi, Recently, my site has been generating errors which say: "Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled...
1
by: Barry L. Camp | last post by:
Hi all, Wondering if someone can help with a nagging problem I am having using a GridView and an ObjectDataSource. I have a simple situation where I am trying to delete a row from a table, but...
1
by: =?Utf-8?B?cm9zczYxMw==?= | last post by:
I really hope this is not a case of "this silly thing will never work".....lots of time invested in troubleshooting this already. I have created a standard ASP.NET web form (.aspx) with several...
0
by: Phillip Ian | last post by:
Tried this over in CSharp.General and didn't get anything, so I thought I'd try again here. If there's an AJAX specific group I could ask this in, please let me know...I did look. I'm trying to...
0
by: fig000 | last post by:
Hi, I'm using an objectdatasource. The insert procedure called by the objectdatasource is in a separate library file outside of the aspx and the codebehind that is using the objectdatasource in...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.