473,387 Members | 1,553 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,387 software developers and data experts.

objectdatasource parameter value from application

Can anyone tell me is there an easy way to get a value into an
objectdatasource select parameter from Application Variables? Obviously its
easy from cookies, session etc... but what about Application? Or is there an
easy way to get a value into an objectdatasource parameter from the
web.config? Kind of like how we get the connection string from web.config
into a datasource object, like:

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:spg_portalsConnectionString %>"

Can I do:

<SelectParameters>
<asp:Parameter Name="dept_id" DefaultValue="<%$ AppSettings:dept %>
</SelectParameters>
Sep 25 '06 #1
1 2867
I didn't try what you have mentioned, but I tried to set parameter value from
code
like this:
ObjectDataSource1.SelectParameters["Param1"].DefaultValue =variable;
I used to do that in Page_Load event and it works fine.
--
Muhammad Mosa
Software Engineer & Solution Developer
MCT/MCSD.NET
MCTS: .Net 2.0 Web Applications
MCTS: .Net 2.0 Windows Applications
"tparks69" wrote:
Can anyone tell me is there an easy way to get a value into an
objectdatasource select parameter from Application Variables? Obviously its
easy from cookies, session etc... but what about Application? Or is there an
easy way to get a value into an objectdatasource parameter from the
web.config? Kind of like how we get the connection string from web.config
into a datasource object, like:

<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$
ConnectionStrings:spg_portalsConnectionString %>"

Can I do:

<SelectParameters>
<asp:Parameter Name="dept_id" DefaultValue="<%$ AppSettings:dept %>
</SelectParameters>
Sep 26 '06 #2

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

Similar topics

12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
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...
4
by: Anne Catterick | last post by:
Hi, I have an british ASP.Net 2.0 application which is doing what (should) be very simple. But I am having issues. On my page I have a GridView as follows (some tags excluded for easy...
7
by: Dabbler | last post by:
I'm using an ObjectDataSource with a stored procedure and am getting the following error when trying to update (ExecuteNonQuery): System.Data.SqlClient.SqlException: Procedure or Function...
3
by: Robert | last post by:
What is the best way to pass a parameter to an ObjectDataSource. I am able to add a new parameter to the SelectParameters, but I would like to just assign a value to an existing parmeter at...
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...
0
by: Bryce Fischer | last post by:
I've got a simple (I think) asp.net application. I've created a DataSet in App_Code/ItemDataSet.xsd. Tested connection, seemed to work fine. In my ASPX file, I first dropped an...
2
by: JJ | last post by:
How can I set an ObjectDataSource's Parameter programmatically? The slight complication here is that I want to set this NOT in the 'Selecting' method of the ObjectDataSource, but elsewhere. I...
3
by: semomaniz | last post by:
I have a ajax reorderlist that displays the contents with out any problems but when i drag and reorder the list nothing happens, i get a postback and the same initial list is displayed, seems like my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.