473,786 Members | 2,407 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 3381
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
1176
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
2657
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
4692
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
8848
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
2127
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
9647
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9492
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,...
1
10108
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
9960
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...
1
7510
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
6744
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
5532
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4064
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
2
3668
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.