DataSource Controls :: Pass Id To ObjectDataSource From DetailsView Control?

Oct 25, 2010

I have an objectDataSource to retrieve data and fill a listBox on edit

I created a BLL method to get the data and set the controlId to the detailsVeiw control but the id is not passed throuh to the bll class

this is my code:

[Code]....

View 1 Replies


Similar Messages:

DataSource Controls :: How To Pass An Object To The Selectmethod Of The Objectdatasource Control

Mar 31, 2011

how to pass an object to the selectmethod of the objectdatasource control?

View 2 Replies

DataSource Controls :: Pass Parameters To The Selectmethod Property Of The Objectdatasource Control

Mar 27, 2011

how to pass parameters to the selectmethod property of the objectdatasource control.

View 1 Replies

DataSource Controls :: How To Pass Variable To ObjectDataSource

Sep 10, 2010

I have an objectDataSource which uses my stored procedure GetNotifications

And my GridView is bound to that objectDataSource

the only problem is that my stored procedure requires the variable @UserName and then returns the values for that username, but I do not know how to pass the variable to the objectDataSource, does anyone know the code for this?

I can get userName from HttpContext.Current.User.Identity.Name but how do I pass that to the objectDataSource?

View 7 Replies

DataSource Controls :: Pass Object As SessionParameter In ObjectDataSource?

Dec 28, 2010

Is it possible to pass a domain object as session parameter in an ObjectDataSource. I'm doing this:

<asp:ObjectDataSource ID="ParticipantsDataSource" runat="server" OnInit="SqlDataSource_Load"
SelectMethod="LoadParticipants" TypeName="SB.Web.units.Players">
<SelectParameters>
<asp:SessionParameter Name="user" SessionField="User" Type="SB.BusinessLogic.DomainEntity.User" />
</SelectParameters>
</asp:ObjectDataSource>

But I get the error message that I can't create an object of the type System.TypeCode from the string containing SB.BusinessLogic.DomainEntity.User for the property Type.

View 1 Replies

DataSource Controls :: Objectdatasource With A Generic Select Method - How To Pass The Type

Mar 14, 2011

[Code]....

[Code]....

The GetList method is as folllowing:

[Code]....

Now i can populate my gridview trough code by this: //gvwDiensten.DataSource = new BindingList<diensten>(dataManager.GetList<diensten>().ToList());But i would like to use an objectdatasource, so i created this:

[Code]....

</asp:ObjectDataSource>

But when running the page i get:

ObjectDataSource 'dsDiensten' could not find a non-generic method 'GetList' that has no parameters.

View 5 Replies

DataSource Controls :: ObjectDataSource - Update Method To Pass Entity To The Method In BLL Class?

Oct 18, 2010

I have an ObjectDataSource that I want to perform updates using a business entity i.e. Type="Object"). Since the values for the entity are within a user control, I have stored a reference to the control in Session and in the updating event, set the new instance to the value of the entity from the user contol property (which also pulls values from the form viaother properties of the control):

Protected Sub MasterDataSource_Updating(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceMethodEventArgs) Handles MasterDataSource.Updating
Dim entity As New Login()
Dim accountControl As AccountInfo = TryCast(Session("AccountCtrl"), AccountInfo)
entity = accountControl.Entity
e.InputParameters.Add("entity", entity)
End Sub

And here's the markup for the datasource:

<asp:ObjectDataSource ID="MasterDataSource" runat="server" EnableCaching="true" CacheDuration="10"
SelectMethod="SelectAll" UpdateMethod="Update" TypeName="Data.DAL.LoginDAL">
</asp:ObjectDataSource>

My question is, how can I get the update method to pass this entity to the update method in my BLL class? It seems the Update method requires an ID or reference to the original object to use in determining whether any changes have taken place, but I don't really want to do this. In other words, I just want to use the Update event on my ObjectDataSource to pass my entity to the method ("Update") I set as a property and then let this business method handle the update of the data. Shown below, is the BLL update method I want to call:

Public Overloads Function Update(ByVal entity As Login)
If entity Is Nothing Then
Throw New ArgumentNullException("entity")
End If
MyBase.Update("UpdateLogin", entity.Username, entity.Password, entity.FirstName, entity.LastName, entity.Role, entity.Region, _
entity.Email, entity.Title, entity.TierID, entity.Street, entity.City, entity.State, entity.Zip, entity.Mobile, entity.Phone, entity.Fax)
End Function

When I try to call this as it stands now, I get an error: ObjectDataSource 'MasterDataSource' could not find a non-generic method 'Update' that has parameters: ID, entity. Previously, I'd set up a long list of parameters of basic data types (string, int, boolean), but this is rather cumbersome and I was hoping to use an entity for this (FYI, I also got the same type of error when I tried this approach, but with the ID as the
last parameter in the list). Perhaps what I'm doing here is atypical to how the ODS is normally used?? Has anyone done something like this successfully?

View 1 Replies

DataSource Controls :: Paging With Repeater Control Binded With Objectdatasource?

Jan 28, 2011

I want to do pagination in repeater control.

I am using repeater.Datasource = objectDataSource.

and objectdatasource is having generic list data.

When i try to cast objectdatasource to dataview ...i am getting exception saying "casting

Collections Generic List cannot be casted to Dataview".

Can anyone tell me easy way to do Repeater Pagination in the above mentioned case

View 4 Replies

DataSource Controls :: Link 2 Objectdatasource Together Using The Control Parameter Source?

Jun 30, 2010

I'm trying to link 2 objectdatasource together using the Control Parameter Source.However, I'm stuck at the screenshot below. The Next button is disabled.

View 1 Replies

DataSource Controls :: Control This Objectdatasource Programatically From The Code Behind Based On Different Button Clicks?

Sep 2, 2010

I have a page where you can search and display other data, very simple layout. 1 Gridview and 1 objectdatasource. But i have 4 possible buttons that can populate the gridview..

i would like to control my objectdatasource from the code behind based on the button you click.

here is what i have right now.. but if possible, can this source not be hardcoded like this and only built in the code behind?

[Code]....

I found this site with a solution to this persons issue, but i cant seem to get mine working this way.

http://stackoverflow.com/questions/2404264/overwriting-controlparameters-of-datasources-in-code-behind

I have this as the code behind right now when you press the button.. what other parameter settings am i missing and is this the right order to populate them for the source to acknowledge my values?

[Code]....

View 8 Replies

DataSource Controls :: SqlDataSource With ASP DetailsView Control?

Apr 27, 2010

I am going to use DetailsView control for the first time and before using it I thought I would like ask this question. Instead of using the SqlDataSource Object/Class Can i have my class to most of the functionality?In short I donot want to use the in build Sql Data Source control rather would prefer to write my own. Is it possible (I know it must be!) to write the custom SqlDataSource class.

View 2 Replies

Forms Data Controls :: Detailsview In Insert Mode With Objectdatasource

Aug 25, 2010

i have a detailsview in insert mode and that is bound to objectdatasource. now the class that is attached to objectdatasource is :

[Code]....

here ResturantId value has to be in session or from Dropdownlist and rest of the value from Detailview. So how to assign that value?

View 3 Replies

Forms Data Controls :: How To Pass A Data To Be Updated In DetailsView Control

Mar 13, 2011

I have an image file to be uploaded and to be updated in my database. I've already write the C# code based in a VB code.

However, I have some trouble to pass a data to be updated through DetailsView Control, by using

DetailsViewUpdateEventArgs e

The column in database is "ImageData"...

In VB the Code is:

e.Values(
"ImageData"
) = imageBytes

ImageBytes is an array of bytes..

View 4 Replies

Forms Data Controls :: Binding Both GridView And DetailsView To A Single ObjectDataSource?

Jan 15, 2010

I'm trying to bind both GridView and DetailsView to a single ObjectDataSource declaratively (in markup). I'm getting the error read as below when I tried to run it.

"The DataSourceID of 'DetailsView1' must be the ID of a control of type IDataSource. A control with ID 'ReservationsDataSource' could not be found."

It works when I bind GridView and DetailsView each seperately to my ObjectDataSource. Is it I can't bind two pagable data web controls to a single datasource?? or there is a trick needed to be done for this to work.

FYI, I'm trying to create a Master/DetailsView of my data. DetailsView of my application should show the record selected in GridView and it should be editable.

View 2 Replies

Forms Data Controls :: DetailsView's ObjectDataSource Update Method Fails?

Jan 15, 2011

I am using a gridview to select a record and control that record using a details view. I am using a class based objectdatasource to link the data for select, update and delete. Sofar the select works but the update fails. Here is my error message:

ObjectDataSource 'odsDetailsView_1' could not find a non-generic method 'UpdateSet' that has parameters: setId, TYPE, iHPlayer, iAPlayer, iHRuns, iARuns, iH8Break, iA8Break, iHe8s8, iAe8s8, iH15BRn, iA15BRn, iHWins, iAWins, SET_ID, MATCH_FK, HOME_MEMBER_ID_FK, AWAY_MEMBER_ID_FK, HOME_TABLERUN, AWAY_TABLERUN, HOME_8BALLBREAK, AWAY_8BALLBREAK, HOME_E8S8, AWAY_E8S8, HOME_15BRN, AWAY_15BRN, HOME_TOTALWON, AWAY_TOTALWON, HOME_POINTS, AWAY_POINTS, LOCKED, GROUP_FK.

The first group of parameters have lower case letters and they come from my objectdatasources update method parameters. The second group of parameters are all capitalized and they are the fields in my SQL database table (and I don't know how they wound up in the error). This might be a clue.When executing the code my class method never gets the chance to execute because the error pops up before the code gets there.

Here is my objectdatasource:

[Code]....

Here is my detailsview:

[Code]....

Here is my class update method constructor:

[Code]....

View 1 Replies

C# - UpdateMethod In ObjectDataSource Only Receive Values For Properties From Visible Controls In DetailsView?

Mar 26, 2010

I've written a class that contains Select- and Update-Methods for an ObjectDataSource. The UpdateMethod receives an instance of a called class. My problem is, that only properties that are Bound in the DetailsView are set, the others have their default value.Here's my code:Class declaration:

public class Foo
{
public string Prop1 {get;set:}
public int Prop2 {get;set;}

[code]...

View 1 Replies

DataSource Controls :: Pass Value To SqlDataSource Control With StoredProc?

Apr 22, 2010

i have a website with a gridview, i bind the SqlDataSource Control that i use for my Gridview with a StroredProc. but the storedproc has to get a value which is from a textbox so that the gridview can display a record.

View 3 Replies

Forms Data Controls :: Pass Parameter To Object Datasource In User Control?

Jun 30, 2010

I have a gridview inside a user control bind to an object datasource. Now I want to bind the object datasource with a parameter from parent page.

For this purpose I defined a public property in user control but how do I pass it with object datasource ?

I am calling from parent page like

myusercontrol.parameter=querystring["id"];

How to bind object datasource with my parameter ?

View 4 Replies

Forms Data Controls :: Bind Data To Detailsview Control Without Datasource?

Nov 10, 2010

i have a detailsview control. in that i have 5 textboxes.

i dont have datasource contrl and any sqlqueries.

when ever i open the page detailsview control statitically should display some values in the textboxes.

then i will insert some values threw businesslogic.

when ever i open the page detailsview display some static values in textboxes.

View 1 Replies

DataSource Controls :: ObjectDatasource And Class As Datasource

Jun 24, 2010

I am really having a hard time trying to write something from scratch I created a 'Person' Class.Public Class Person

Private _FirstName As String = ""
Private _LastName As String = ""
Private _Age As Integer = 0
Public Sub New(ByVal FirstName As String, ByVal LastName As String, ByVal Age As Integer)
FirstName = FirstName
_LastName = LastName
_Age = Age
[code]...

View 1 Replies

Forms Data Controls :: Pass Selected Keyname To DetailsView?

Sep 6, 2010

I have a gridView and DetailsView.gridView.enabledselection=true. when I select a row I want to display that record in DetailsView.I have done it previously but after lot of php coding, I forgot it :S can someone remind it to me?there is something datakeyname or something like this parameters to specify

View 5 Replies

DataSource Controls :: Objectdatasource Does Not Run?

Jan 26, 2010

I have set the objectdatasource in the web form. Does I need to check anything as I find that method "objProductSuppliment_Inserted" does not run??

-----------------------------------------------------------------------------------------------------------

<asp:ObjectDataSource ID="objProductSuppliment" runat="server"
OnInserted="objProductSuppliment_Inserted"
TypeName="BLL.WMS.ProductSuppliment"

[code]...

View 6 Replies

Forms Data Controls :: Pass Values From Gridview To Detailsview On SelectedIndexChanged

Jun 7, 2010

how can i populate the detailview in insert mode with values from gridview on selection?

Filter by date:
<asp:DropDownList ID="DropDownList4" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource3"
DataTextField="CDATE" DataTextFormatString="{0:D}" DataValueField="CDATE">
</asp:DropDownList>

[Code]...

View 6 Replies

DataSource Controls :: Objectdatasource Does Not Bind The Name And ID?

Jan 16, 2011

I've created a query in the table adapter for retrieving customer name based on the first letter. The query is executed fine, and the output is the customer name and ID. A Customer BLL accesses this query, and sends the results to an objectdatasource. This control is configured to use this customer-by-letter query. However for some reason, this objectdatasource does not bind the name and ID, but instead all the other fields produced by the main query in the table adapter (i.e. name, address, phone, etc....).

I'm probably not configuring something correctly, but I'm not sure what.

The BLL code:

[Code]....

The .net code:

[Code]....

View 4 Replies

DataSource Controls :: BLL Add Method & ObjectDataSource?

Jan 4, 2011

My Business Logic Layer has AddItem method that add's to Items table in db along with an entry in Balance table.AddItem method uses two TableAdapters Items & Balance. Both these have corresponding Business Objects as Item and Balance.

Here is the AddItem method :

[Code]....

ASPX Page with DetailsView & ObjectDataSource

[Code]....

Now executing this page generates error as

ObjectDataSource 'ObjectDataSource2' could not find a non-generic method 'AddItem' that has parameters: _item, _balance, ItemName, GroupId, CategoryId, AuId, Rate, TotalStrScale, OffsStrScale, OffsAE [code]...

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved