473,770 Members | 2,273 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

CodeBehind for ObjectDataSourc e.TypeName

Visual Studio 2005/ ASP.Net 2.0
DAL in C# exclusively using XSD (strongly typed datasets)
WEB in C# references the DAL as needed via ObjectDataSourc es

My app has about 5 or 6 "reference" tables that I am creating a
"maintenanc e" web page for. The page has a dropdown control that lists
all of the reference table names. You pick the "Status Ref" item and
the GridView is refreshed to show the status data. Pick the "Stage
ref" item and the GridView is refreshed it show the stage data...you
get the idea.

The SelectedIndexCh anged event on the dropdown table does something
similar to the following:

string ta = ddl.SelectedVal ue;
string typName = "DAL.dalTableAd apters." + ta + "TableAdapt er";
ods.TypeName = typName;
gv.DataSourceID = ods.ID;

The ods is an object in the HTML markup where GetData, Update, etc are
all set...just TypeName is empty.

When the GridView refreshes to show the data, all looks well. However,
clicking Edit on the GridView produces the following error:

A type must be specified in the TypeName property of ObjectDataSourc e
'ods'.

I can overcome this by assigning the TypeName in Page_Load...but then I
lose all of the updated values. Looking at the sql trace stuff it's
the old values that are being posted back which tells me that if I set
TypeName in Page_Load I am overwriting the values.

So, you can see the dynamic need to have the TypeName blank in the html
markup and have it set dynamically on SelectedIndexCh anged. The only
other solution is to create a separate page for each reference table
with all of the proper tableadapater stuff hard coded in the html
markup...I'd prefer not to do that.

Any ideas?

Jun 2 '06 #1
0 1822

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

Similar topics

2
2120
by: motorhead_maniac | last post by:
hi All, Iam having a objectdatasource control declared in the markup as <asp:ObjectDataSource ID="odsProperties" runat="server" TypeName="System.Collections.IEnumerable" SelectMethod="GetProperties"></asp:ObjectDataSource>
0
1175
by: Ashish | last post by:
Hi All, I want to be able to specify typename property of the object datasource to the classname of the code behind of the user control that its declared on.. for example <asp:ObjectDataSource ID="odsImageSets" runat="server" TypeName="Controls_ImageSets
0
6992
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 ObjectDataSource onto the form, and pointed it to the dataset created above. I then dropped a GridView on the form, and selected the ObjectDataSource I created above. In the Design view it seems to be at least loading the
5
2656
by: Randy Smith | last post by:
Hi ALL, I wonder if anyone has been using n-tier to bind to a GridView control by using the ObjectDataSource. This is our first OOP web application, and we have no tables. Right now we are simply working with objects in memory. So, it appears as though Microsoft requires that our datamapper classes reside inside a folder called "App_Code", and NO WHERE ELSE. So, has anyone successfully been able to place their datamappers in a...
1
3538
by: Allan Ebdrup | last post by:
I have a asp.net v2 website that runs fine on our development server. I have published the website to a stage server and it runs fine, but when I publish it to production I get the following error: The type specified in the TypeName property of ObjectDataSource 'PositionPostingsDataSource' could not be found. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...
0
5521
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 code what I think is a fairly typical Master/Detail scenario with two GridViews, using AJAX. Using the Northwind sample, I have two ObjectDataSources - one which pulls data from the Orders table, and one that pulls the related data from . Each...
0
1516
by: jobs | last post by:
re: ObjectDataSource SelectMethod TypeName returning a Dataset? is this really a DAL? Pardon my misguided email on the subject... I'm working in asp.net 2.0 and vb.net 2005. Say I don't want any SQL code in my presentation layer, and I want all my SQL operations accessable through methods I've developed in vb.net of a class I will conviently call MyDAL.
1
2126
by: yanni | last post by:
Hello, I'm creating asp.net 2.0 web site app, I tried to use ¡°ObjectIssue.Page1¡± as TypeName of ObjectDataSource, received error message ¡°The type specified in the TypeName property of ObjectDataSource 'object1' could not be found.¡±, If I instead use a class in App_Code folder as TypeName, it works find. But I can¡¯t figure out why it didn¡¯t work for aspx page class?
3
11195
by: btreddy | last post by:
Hii all, I've a problem regarding passing select parameters to objectdatasource from code behind. i would like to pass the select parameters to a objectdatasource ..not in the selecting or selected event of the objectdatasource but some where in the one of button click event. i tried of adding the parameters but it didn work for me.. <asp:ObjectDataSource ID="ODSEditSchedules" TypeName="Schedules" runat="server"...
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.