473,396 Members | 2,023 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,396 software developers and data experts.

How to implement a variable lenght objectdatasource bound to a detailsview

shnaqawi
Dear Friends,

I have an objectdatasource which is bound to a details view. the no. of columns are variable. I could do the select function by defining a dynamic sqlSelectCommand. The problem now is that how can I have an update function for myobjectdatasource? I tried a function with variable arguments within an array but after that the objectdatasource asked for defining the parameter for the array. I don't know how to implement the update function in c#. Is there any other way to implement it?

Thanks,
-Hassan
Feb 12 '09 #1
2 1657
Frinavale
9,735 Expert Mod 8TB
You need to write multiple update functions.
Each update function will accept the number of parameters (with the same names as the columns) required to update the columns.

If your data source has 5 columns and you want to update all 5, then you need to write an update function that accepts 5 parameters that have the same names as your columns.

Now say your data source only has 3 columns the next time, you need to also provide an update function that accepts 3 that match the names of the columns being submitted.

The update functions will all have the same name, they will just be over loaded, each accepting a different number of parameters.

-Frinny
Feb 12 '09 #2
Thanks for your reply.
The Numbers and Names of the columns are variable. and I have no idea that what would they be?
I'm designing an online e-training management system. the administrator would be able to add different courses along with adding a variable no. of modules for each of them. now when she associate a new trainee with a course she should also be able to add the scores of each module to the score table for that trainee. Now the problem is that I don't know what are the future courses and modules. That's why I'm looking for a solution by defining a variable length argument for the Update function.
Or maybe I should change the design totally?

-Hassan
Feb 15 '09 #3

Sign in to post your reply or Sign up for a free account.

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...
2
by: Ram | last post by:
I have an issue with detailsview control bound to an objectdatasource. scenario is i have a business logic component with CRUD methods that accept custom business entity objects. In asp.net layer...
3
by: CWWong | last post by:
I am using DetailsView using ObjectDataSource with DataSourceTypeName assigned to the specific class. SelectMethod, UpdateMethod and DeleteMethod is working successfully, except InsertMethod. The...
1
by: ThomasNexoe | last post by:
Hi there, I quite new to posting in this forum. I have a problem which I truly hope someone can help me out. I have a master/detail page - with a gridview displaying company names, and a...
2
by: Damon | last post by:
Help! Need this fixed ASAP. I have a GridView/DetailsView master/details form set up, with both bound to separate ObjectDataSource objects. Both the GridView and the DetailsView have a...
1
by: J055 | last post by:
Hi I have a Business class called User which returns a DataRow for individual user accounts using accountID as a parameter (i.e. User.Retrieve(accountID)). The ObjectDataSource doesn't complain...
2
by: Frank | last post by:
Hello All, I am coding with VS.NET 2005 and attempting to execute a somewhat complicated sql query. I have created a DataLayer and an objectDataSource, bound to a DetailsView; This work no...
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: Cirene | last post by:
Using Visual Studio I created a DataSet using the GUI (XSD file). Trying to use a tiered methodology I called the functions from my BLL. Namespace Zzz.BusinessLogicLayer #Region "DAL Access"...
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.