473,387 Members | 1,799 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,387 software developers and data experts.

Can not find TypeName of ObjectDataSource

I have this class file within the App_Code folder
CorrectionsDB.cs

namespace CorrectionsDB.cs
{

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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

public static System.Data.DataSet GetCampaign()
{
string connectionString =
ConfigurationManager.ConnectionStrings["Development"].ConnectionString;
System.Data.IDbConnection dbConnection = new
System.Data.SqlClient.SqlConnection(connectionStri ng);
string queryString = "Select Campaign from tCampaigns Order
By Campaign";
System.Data.IDbCommand dbCommand = new
System.Data.SqlClient.SqlCommand();

dbCommand.CommandText = queryString;
dbCommand.Connection = dbConnection;

System.Data.IDbDataAdapter dataAdapter = new
System.Data.SqlClient.SqlDataAdapter();

dataAdapter.SelectCommand = dbCommand;

System.Data.DataSet dataSet = new System.Data.DataSet();

dataAdapter.Fill(dataAdapter);
return dataSet;
}
}
}

..... and this .aspx file

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gift.aspx.cs"
Inherits="gift" %>
<%@ Register TagPrefix="CorrectionsDB" Namespace="CorrectionsDB.cs"
Assembly="App_Code/CorrectionsDB.cs" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tr>
<td style="width: 170px">Campaign</td>
<td width="230">
<asp:DropDownList ID="DropDownnList1" runat="Server"
DataSourceID="ObjectDataSource1" DataTextField="campaign"
DataValueField="campaign" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="CorrectionsDB" SelectMethod="GetCampaign" />
</td>
<td width="170">Campaign</td>
<td width="230">
</td>
</tr>

Dec 20 '06 #1
1 3348
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.cs.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.cs

namespace CorrectionsDB.cs
{

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

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

public static System.Data.DataSet GetCampaign()
{
string connectionString =
ConfigurationManager.ConnectionStrings["Development"].ConnectionString;
System.Data.IDbConnection dbConnection = new
System.Data.SqlClient.SqlConnection(connectionStri ng);
string queryString = "Select Campaign from tCampaigns Order
By Campaign";
System.Data.IDbCommand dbCommand = new
System.Data.SqlClient.SqlCommand();

dbCommand.CommandText = queryString;
dbCommand.Connection = dbConnection;

System.Data.IDbDataAdapter dataAdapter = new
System.Data.SqlClient.SqlDataAdapter();

dataAdapter.SelectCommand = dbCommand;

System.Data.DataSet dataSet = new System.Data.DataSet();

dataAdapter.Fill(dataAdapter);
return dataSet;
}
}
}

..... and this .aspx file

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gift.aspx.cs"
Inherits="gift" %>
<%@ Register TagPrefix="CorrectionsDB" Namespace="CorrectionsDB.cs"
Assembly="App_Code/CorrectionsDB.cs" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<tr>
<td style="width: 170px">Campaign</td>
<td width="230">
<asp:DropDownList ID="DropDownnList1" runat="Server"
DataSourceID="ObjectDataSource1" DataTextField="campaign"
DataValueField="campaign" />
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
TypeName="CorrectionsDB" SelectMethod="GetCampaign" />
</td>
<td width="170">Campaign</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
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"...
0
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...
0
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...
5
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...
0
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...
5
by: Jess | last post by:
Hello, I've seen two forms of template declarations template<typename T> class A{...}; and template<class T>
1
by: HockeyFan | last post by:
protected void gvAuthorizedSigners_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "EmptyInsert") { odsAuthorizedSigners.Insert(); return; } if (e.CommandName...
9
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...
1
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.