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

Home Posts Topics Members FAQ

Can not find TypeName of ObjectDataSourc e

I have this class file within the App_Code folder
CorrectionsDB.c s

namespace CorrectionsDB.c s
{

using System;
using System.Data;
using System.Configur ation;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;

/// <summary>
/// Summary description for CorrectionsDB
/// </summary>
public class CorrectionsDB
{
public CorrectionsDB() { }

public static System.Data.Dat aSet GetCampaign()
{
string connectionStrin g =
ConfigurationMa nager.Connectio nStrings["Developmen t"].ConnectionStri ng;
System.Data.IDb Connection dbConnection = new
System.Data.Sql Client.SqlConne ction(connectio nString);
string queryString = "Select Campaign from tCampaigns Order
By Campaign";
System.Data.IDb Command dbCommand = new
System.Data.Sql Client.SqlComma nd();

dbCommand.Comma ndText = queryString;
dbCommand.Conne ction = dbConnection;

System.Data.IDb DataAdapter dataAdapter = new
System.Data.Sql Client.SqlDataA dapter();

dataAdapter.Sel ectCommand = dbCommand;

System.Data.Dat aSet dataSet = new System.Data.Dat aSet();

dataAdapter.Fil l(dataAdapter);
return dataSet;
}
}
}

..... and this .aspx file

<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="gift. aspx.cs"
Inherits="gift" %>
<%@ Register TagPrefix="Corr ectionsDB" Namespace="Corr ectionsDB.cs"
Assembly="App_C ode/CorrectionsDB.c s" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<tr>
<td style="width: 170px">Campaign </td>
<td width="230">
<asp:DropDownLi st ID="DropDownnLi st1" runat="Server"
DataSourceID="O bjectDataSource 1" DataTextField=" campaign"
DataValueField= "campaign" />
<asp:ObjectData Source ID="ObjectDataS ource1" runat="server"
TypeName="Corre ctionsDB" SelectMethod="G etCampaign" />
</td>
<td width="170">Cam paign</td>
<td width="230">
</td>
</tr>

Dec 20 '06 #1
1 3380
thanks! I think that worked, but I'm now getting a "Parser Error"..

"Could not load file or assembly 'CorrectionsDB. cs' or one of its
dependencies. The system cannot find the file specified"

in reading many of the post on google, it seems as though this is a
system issue rather than a programming one. Are you familiar with such
a problem.
regards,
v

Peter wrote:
The type name is the namespace +the class name, or in this case,

CorrectionsDB.c s.CorrectionsDB

Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"vn****@hotmail .com" wrote:
I have this class file within the App_Code folder
CorrectionsDB.c s

namespace CorrectionsDB.c s
{

using System;
using System.Data;
using System.Configur ation;
using System.Web;
using System.Web.Secu rity;
using System.Web.UI;
using System.Web.UI.W ebControls;
using System.Web.UI.W ebControls.WebP arts;
using System.Web.UI.H tmlControls;

/// <summary>
/// Summary description for CorrectionsDB
/// </summary>
public class CorrectionsDB
{
public CorrectionsDB() { }

public static System.Data.Dat aSet GetCampaign()
{
string connectionStrin g =
ConfigurationMa nager.Connectio nStrings["Developmen t"].ConnectionStri ng;
System.Data.IDb Connection dbConnection = new
System.Data.Sql Client.SqlConne ction(connectio nString);
string queryString = "Select Campaign from tCampaigns Order
By Campaign";
System.Data.IDb Command dbCommand = new
System.Data.Sql Client.SqlComma nd();

dbCommand.Comma ndText = queryString;
dbCommand.Conne ction = dbConnection;

System.Data.IDb DataAdapter dataAdapter = new
System.Data.Sql Client.SqlDataA dapter();

dataAdapter.Sel ectCommand = dbCommand;

System.Data.Dat aSet dataSet = new System.Data.Dat aSet();

dataAdapter.Fil l(dataAdapter);
return dataSet;
}
}
}

..... and this .aspx file

<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="gift. aspx.cs"
Inherits="gift" %>
<%@ Register TagPrefix="Corr ectionsDB" Namespace="Corr ectionsDB.cs"
Assembly="App_C ode/CorrectionsDB.c s" %>
<%@ Import Namespace="Syst em.Data" %>
<%@ Import Namespace="Syst em.Data.SqlClie nt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<tr>
<td style="width: 170px">Campaign </td>
<td width="230">
<asp:DropDownLi st ID="DropDownnLi st1" runat="Server"
DataSourceID="O bjectDataSource 1" DataTextField=" campaign"
DataValueField= "campaign" />
<asp:ObjectData Source ID="ObjectDataS ource1" runat="server"
TypeName="Corre ctionsDB" SelectMethod="G etCampaign" />
</td>
<td width="170">Cam paign</td>
<td width="230">
</td>
</tr>
Dec 21 '06 #2

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...
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.
5
425
by: Jess | last post by:
Hello, I've seen two forms of template declarations template<typename T> class A{...}; and template<class T>
1
4691
by: HockeyFan | last post by:
protected void gvAuthorizedSigners_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EmptyInsert") { odsAuthorizedSigners.Insert(); return; } if (e.CommandName == "Insert")
9
8847
by: Kernel Bling | last post by:
Hi Everyone, This Saturday the stage was set. The problem simply could not go on existing -- it had to be solved. Many hours, articles, compilations and frustrations later I still did not find an answer. Even pacing around my flat until I nearly went into an altered state of reality proved futile. So here is the problem... When I link up the ObjectDataSource UpdateMethod to a method in the
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?
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...
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...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.