How To Configure Update Method For Object Data Source
Jun 26, 2010
I have a gridview with all columns read only except one. I want to configure the update method for the object data source to update only one column. The code i have written works when i make all columns editable but fails when i try to make only one column editable.
View 1 Replies
Similar Messages:
Aug 10, 2010
When my page is first loaded i receive error message stating to the effect
cant find Email for GetInvoicesByVendor.
this refers to a function in another class file:
Public Shared Function GetInvoicesByVendor(ByVal Email As String, ByVal vendorid As Integer) _
As IEnumerable
yet i only want to execute this function during the button click event and not when page is first loaded with the following parameters:
vendorid.Text = 1
txtcustomerid.Text = test@yahoo.co.uk
My objectdatasource is declared as follows:
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
OldValuesParameterFormatString="original_{0}"
SelectMethod="GetInvoicesByVendor" TypeName="InvoiceDB">
<SelectParameters>
<asp:ControlParameter ControlID="txtcustomerid" Name="Email"
PropertyName="Text" Type="String" />
<asp:ControlParameter ControlID="vendorid" Name="vendorid" PropertyName="Text"
Type="Int32" />
</SelectParameters>
</asp:ObjectDataSource>
View 2 Replies
Jun 15, 2010
I have extended GridView in order to have consistent look & feel, paging and sorting. However, when the page is first time loaded, the select method is getting called twice. It works fine when i move between pages in pagination.
Note, i am using Asp.net 2.0.
View 2 Replies
Jun 12, 2010
I'm selecting table data of the current user:
SELECT [ConfidenceLevel], [LoveLevel], [HappinessLevel] FROM [UserData] WHERE ([UserProfileID] = @UserProfileID)
I have set a control to the unique user ID and it is getting the correct value:
HTML: <asp:Label ID="userID" runat="server" Text="Labeluser"></asp:Label>
C#: userID.Text = Membership.GetUser().ProviderUserKey.ToString();
I then use it in the where clause using the Configure Data Source window unique ID = control then controlID userID(fills in .text for me)
I compile and run but nothing shows up where the table should be.
Here is the code it has created:
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="ConfidenceLevel" HeaderText="ConfidenceLevel"
[Code]....
View 1 Replies
Jan 5, 2010
I don't know it happen just to me or Others have the same situation too . All the time when i bind a DataControl to an ObjectDataSource in "Configure Data Source" wizard of ObjectDataSource,when i set parameter source as "Control" in "ControlId" DropdownList there are TWO Item of every control in the WebForm , while it make sense be one.
View 2 Replies
Oct 29, 2010
I am using visual studio 2008, i included a class in the AppCode folder and wated to use its functions in ObjectDataSource.
View 4 Replies
Mar 23, 2011
I downloaded the latest version of Visual Web Developer Express. I created an Access (.accdb) database with a table and one record inside it. I dropped a grid view onto my page and selected 'Configure Data Source'. It only wants (.mdb). I have searched the web and discovered bits and peices of information but nothing really in depth that shows me how to fully utilize an (.accdb) Access Database with Visual Web Developer Express Edition. Can someone give me an explanation of how to set up my .aspx page for C#?
View 9 Replies
May 10, 2010
I've posted the same question in the Object Data Source forum. This is a link to it http://forums.asp.net/t/1554083.aspx. Maybe I should've posted here to begin with. There seemed to be some overlap so I wasn't sure which was the best on to post the question in.
I'm trying to get a better understanding of how I could've designed my app so that the Object Data Source could work with the properties of my business objects. Please read the other post to see how it's currently being done. Sorry for the link to the other page. I didn't want to post a bunch of duplicate information. I would love to get some suggestions for alternative ways of doing this.
View 1 Replies
May 18, 2010
When i open the The Configure Data Source wizard, the "Specify columns from a table or view" shows gray, I cannot choose it. How can I do it.
View 4 Replies
May 3, 2010
Traditionally with an Object Data Source, the wired up class will have its public properties available for binding (i.e. Gridview columns, etc.) which works well. But what if one of my wired up business objects has a property that is an object itself; can I drill down to a property on that object property and still use it?
So in additiona to the traditional:MyBusniessObject.OrderID...I want to use:MyBusniessObject.Customer.NameID
Your 1st response might be to just wire up the 'Customer' class, but I need properties both on 'MyBusinessObject'and 'Customer'. I do not think this can be done, as the ODS will not display properties on an object instance property. I have tried manually typing in the drilled down value as well, but that wasn't a success either.
View 4 Replies
Nov 22, 2010
I think I'm getting mad here...I thought this should be super simple, but I just can't figure out how to do that.This is what I'm trying to do:I want to create an rdlc report using the ReportViewer control in ASP.NET 4 (VS 2010), and, as its datasource, use a class with some properties.I tried everything I can think of, but I just can't figure this out. All the docs I found state that the object should appear in the DataSource pane of the website, but I can't make it appear there.I would like the fields of the class to appear in the report desiger so I can use them - but I can't do that either.Using the designer, I can only define new dataset - I don't want to use dataset, but business objects!So - how can I do that? Do I have to use some kind of DataSource control? How can I make the report designer know about the business object?
View 2 Replies
Aug 20, 2010
I am writting a website using .net in some of my pages I need to use datagrid for showing some datas and for binding my data to datagrid I use object datasource something like below :
//this is
public class userData
{
private long userid = 0;
private string username = null;[code]....
and then in my apsx file I put an objectdatasource and bind the select statement to the GetUsersAmount() and then bind obejctdatasource to my datagrid but I think the way I've chosen is not efficient I just want to hear about your way of doing such these things.
View 3 Replies
Jun 21, 2013
I set up a DAL layer in a dll. This had a couple poorly named methods such as GetData(), which is the default name offered up in the tableAdapter wizard. I also added a few other methods for various reasons, all with better names. I then built the dll and referenced it in an ASP project. On one page, I added an ObjectDataSource, and set it to that tableAdapter (which isn't what I wanted to do, but that's a different story). Under the Select tab, I see the GetData and the other methods. Under the Update tab I see a variety of Update methods. Under the Insert and Delete tabs....I see the same methods as I saw under the Update tab. The Insert and Delete methods that exist for the tableAdapter were not available.
I figured that I did something wrong, and I didn't like that GetData name, so I went back to the dll and changed some things around (I think I added an Insert and Delete method, but by now I can't remember, except to say that I wasn't all that surprised not to see those two methods the first time). I also changed the GetData name to something else, then rebuilt the dll.
Since that time, I have yet to be able to change what shows up in the Object Data Source configuration. The Select adamantly insists on the GetData method, which no longer exists under that name, while the other three tabs all show a variety of Update methods, but neither Insert nor Delete. I noticed that just adding a reference didn't have any impact until the ASP project was built, which moved the dll to the bin folder where it needs to be for the Object Data Source configuration wizard to see it. Therefore, I deleted the dll from the bin folder, then rebuilt. I've also removed the reference, deleted the dll from the bin folder, rebuilt, added the reference, rebuilt again to get the dll back into the bin folder, and anything else I can think of. It still seems to be retaining the original schema from the tableadapter without ever updating to the new name for the GetData. Since that hasn't updated, the rest doesn't surprise me.
View 25 Replies
Apr 12, 2010
I am using VS 2008 SP1. My also have included CSS Friendly adapter [URL] in my project ( I mentioned this because my GridView Empty data template is not showing when using GridView's CCS Friendly adapter). I have a GridView and a DetailsView. When a record in GridView is selected its details information is shown in the Details View. Type of Data source I am using is ObjectDataSource. My Insert and Update methods works perfectly. It is only the Delete method that is passing null values to the underlying object delete method. My source codes for both the UI, BLL, DAL is shown below
[Code]....
My Business Object code is below :
[Code]....
My Data Access Layer Code is:
[Code]....
View 2 Replies
Jun 22, 2010
I am developing on application in that i have taken one list box and getting data to it using an object source.up to this stage it is fine.I need to compare these value what i get into list box and need to represent data in to a report viewer ..how to get these values from objectsource.i m new to c# i placing the code.
[Code]....
View 1 Replies
Feb 2, 2011
I am using Object Data Source to bind data in the gridview. I haveset the property AllowSorting=true. While running the application, Icould sort the data only in ascending order. Is there any way toachieve two way sorting in gridview ie. both ascending and descendingon successive clicks ?.
View 1 Replies
Jan 7, 2010
I have an object data source that is being used by an rdlc report, and the object data source uses a filter that is built from session variables passed to the page.
The report displays correctly, with the filter applied; however, I want to mark each of the rows as "printed" in a bit field in the database table.
In the table adapter, I have the following Update command that is used by the object data source:
UPDATE dbo.WorkOrder
SET boolWorkOrderPrinted = 'True'
WHERE (WorkOrderID = @Original_WorkOrderID)
And in the Page Load event, I run:
ObjectDataSource1.Update();
However, no records are updated.
View 1 Replies
Nov 16, 2010
I used bind all GridViews, DetailViews etc. on my page using an ObjectDataSource (unless it wasn't possible to do so). Recently, I've started binding all my contols programatically. I find this a lot cleaner and easier, though some may disagree. Binding with a ObjectDataSource obviously has it advantages and disadvantages, as does doing it programatically.Say I bind a GridView programatically (e.g. GridView1.DataSource = SomeList), when I change page on the GridView, I have to also code this. Each time the page changes I have to call GridView1.DataSource = SomeList again. Obviously with a ObjectDataSource I don't need to do this. I normally stick my SomeList object into the ViewState so when I change page I don't need to hit the database each and every time.
My question is: Is this how the ObjectDataSource works? Does it store it's data in the ViewState and not hit the database again unless you call the .Select method? I like to try and get the best performance out of my applications and hit the database as few times as possible but I don't really like the idea of storing a huge list in the ViewState. Is there a better way of doing this? Is caching per user a good idea (or possible)? Shall I just hit the database everytime instead of storing my huge list in the ViewState? Is it sometimes better to hit the database than to use ViewState?
View 1 Replies
Mar 17, 2011
I used MySql for the database and download both the ODBC and .NET connetors (drivers) for it. Everything worked. Then, about 2 years ago, the server had to be replaced and the intranet was not put back on like it was originally. I had it as the default website. The contract computer guys made itNot the default. Everything works on the site as it did except for the ASP.NET Configuration page, the one that you click on from within Visual Web Developer by going to Website>ASP.NETConfiguration.
web.config is <add name="connectionString" connectionString="Database=mydb;Data Source=localhost;User Id=xxxxx;Password=pppppp"/>
Line 23: using System.Web.Security;Line 24: Line 25: using MySql.Data.MySqlClient;Line 26: using MySql.Data.Types;Line 27:
View 3 Replies
Nov 18, 2010
I want to call a method in the code behind file from the aspx file, but I can't get the TypeName propery correct.
I can call methods in the dll:s in the bin folder and from files in the app folder, but not from code behind in the aspx page. What do I need to do.
View 1 Replies
Oct 8, 2010
I am playing about just now trying to teach myself a little bit about the entity framework. I have a Gridview data bound to a Entity Date Source using the Entity Framework. If I select certain items in that list I then wish to redirect another page and populate another gridview with just the items selected (but with more detail, different includes/navigation properties)
This is probably the most simple thing but I have spent 2 hours banging my head on the wall trying to get this to work. Essentially I have a continue button which when clicked should identify all the UIDs (a column in the gridview) of the rows and allow me to subset to just these rows and pass them to another page to be rebound to another datagrid
View 2 Replies
Sep 27, 2010
i wanted to retrieve things from the data base and perform mathmatical operations on it then post it to the user, so i was told to use the bullited list and bind it to the object dataSource
how to perform such thing??
View 1 Replies
Sep 15, 2010
In ASP.NET Webforms have an ASP.NET GridView connected to a C# class via an object data source
I have an ID set up as a DataKeyName in the grid. How do I pass this to the C# class when I update the grid?
View 15 Replies
Sep 20, 2010
my query is SELECT a.HD, a.HEAD, a.SH, a.SUBHEAD, a.TRK, a.TRACK, a.TGT, a.TARGET, a.PDC, a.DT_RELEASE, a.STATUS, a.CO
FROM V_HIERARCHY1 a
my data is ,HR HR Rec Records Leave Leave Records HRL.0001 Policy and Process for leave record. 27.06.2010 30.06.2010 WIP Edlink
HR HR Rec Records Leave Leave Records HRL.0002 Quarterly Review 01.07.2010 04.07.2010 Planned Edlink
HR HR DB Database SAL Salary DDS.0001 Calculation of Monthly salary 08.08.2010 09.08.2010 WIP Edlink
HR HR Rec Records Ind Induction Records HRI.0001 Completion of dossiers. 08.07.2010 10.07.2010 WIP Edlink
HR HR DB Database Emp Employee HDE.0001 Offer letter 06.07.2010 09.07.2010 WIP Edlink
my outout is ,HR
REC
LEAVE
HR1
REC1
LEAVE1
View 1 Replies
Oct 12, 2010
I'm working on a site where we want to include a pie chart on a page. Right now I'm working on implementing that through Reporting Services (RDLC file) with an object data source.The SelectMethod of my object data source is a method that returns a list of business objects; lets say a List<Alpha> and Alpha has a sub object Beta with a Name property. In my report definition I have set the Category groups to be: =Fields!Beta.Value.Name this means that Alpha.Beta.Name are my pie slices. I got the following error:
An error has occurred during report processing. The Group expression for the rouping 'chart1_CategoryGroup1' contains an error: Object variable or With block variable not set.I was able to confirm this is because Beta is nullable and was able to fix the issue by updating the object Alpha to return a new Beta() if the Beta property is null. This solution is not ideal though because there are other places in my code where I need Beta to be null if it doesn't have a value yet.Is there a way to update the report definition to accept a null property as valid? Ideally I would like to specify the value as "Not Set" if Beta is null.
View 1 Replies