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

CS0234 - Are you missing a reference?? Works on localhost, not on server.

Hi,

I'm fairly new to .NET and having problems getting an ASP.NET page
working on my web host.

The page works fine on my PC running against localhost. I have a MySQL
database and a simple C# app with an odbcConnection object,
odbcDataAdapter and a datasetCustomers object placed on the form.

On page load, I fill the datasetCustomers from the "Customers" table
retrieved via the odbcDataAdapter and then bind this to a DataGrid on
the form - this works perfectly on localhost and the web-page displays
the contents of the Customers table.

I've got the same database on the webhost and I'm fairly sure it
should all work, but I get the following error: -

Compiler Error Message: CS0234: The type or namespace name
'dsCustomers' does not exist in the class or namespace
'BoundMySQLTest' (are you missing an assembly reference?)

Source Error:
Line 24: protected System.Data.Odbc.OdbcCommand odbcInsertCommand1;
Line 25: protected System.Web.UI.WebControls.DataGrid DataGrid1;
Line 26: protected BoundMySQLTest.dsCustomers dsCustomers1;
Line 27:
Line 28: private void Page_Load(object sender, System.EventArgs e)

It states the error is with line 26.

The only change I've made before uploading it is to change the top
line in Webform1.aspx from: -

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="BoundMySQLTest.WebForm1"%>

to: -

<%@ Page language="c#" Src="WebForm1.aspx.cs" AutoEventWireup="false"
Inherits="BoundMySQLTest.WebForm1"%>

For some reason, none of my projects work on my webhost with the
"Codebehind" line - I always have to change it to Src.

Other than this, the project is identical - works on localhost, but
not on my webserver.

I've had a good read around on here - read a few articles about
manually adding references in the Global.asax, but I have to admit I'm
still fairly confused.

Any help would be greatly appreciated,

Mark.
Nov 18 '05 #1
2 8487
Mark wrote:
Hi,

I'm fairly new to .NET and having problems getting an ASP.NET page
working on my web host.

The page works fine on my PC running against localhost. I have a MySQL
database and a simple C# app with an odbcConnection object,
odbcDataAdapter and a datasetCustomers object placed on the form.

On page load, I fill the datasetCustomers from the "Customers" table
retrieved via the odbcDataAdapter and then bind this to a DataGrid on
the form - this works perfectly on localhost and the web-page displays
the contents of the Customers table.

I've got the same database on the webhost and I'm fairly sure it
should all work, but I get the following error: -

Compiler Error Message: CS0234: The type or namespace name
'dsCustomers' does not exist in the class or namespace
'BoundMySQLTest' (are you missing an assembly reference?)

Source Error:
Line 24: protected System.Data.Odbc.OdbcCommand odbcInsertCommand1;
Line 25: protected System.Web.UI.WebControls.DataGrid DataGrid1;
Line 26: protected BoundMySQLTest.dsCustomers dsCustomers1;
Line 27:
Line 28: private void Page_Load(object sender, System.EventArgs e)

It states the error is with line 26.
What is "dsCustomers" exactly?
The declaration seems to specify that it's a class in the BoundMySQLTest namespace,
but a name like this I personally would use to specify a variable pointing to
a DataSet that contained "customer" details.

The only change I've made before uploading it is to change the top
line in Webform1.aspx from: -

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs"
AutoEventWireup="false" Inherits="BoundMySQLTest.WebForm1"%>

to: -

<%@ Page language="c#" Src="WebForm1.aspx.cs" AutoEventWireup="false"
Inherits="BoundMySQLTest.WebForm1"%>

For some reason, none of my projects work on my webhost with the
"Codebehind" line - I always have to change it to Src.

The "codebehind" is used by VS.Net and you run it (locally) by compiling
the codebehind into a dll that is then used.
When you upload all sourcefiles (aspx.cs) and no dll's (see bin directory)
then it needs to be changed to "src" so that the system can again find the
codebehind files and compile them.

Within VS.Net there is a "Copy Project" function to send all files needed
to a webserver. This will include the compiled dll's and exclude the .cs
(as they are not needed). Make sure that all support files (like xml files)
that you want to have at that webserver have a "build action" of "content"
instead of "none" (see file properties).

Other than this, the project is identical - works on localhost, but
not on my webserver.

I've had a good read around on here - read a few articles about
manually adding references in the Global.asax, but I have to admit I'm
still fairly confused.

Any help would be greatly appreciated,

Mark.

Nov 18 '05 #2
Thanks for the reply Hans,

dsCustomers is the automatically generated data set (apologies - I've
called it datasetCustomers in my explanation) - that I created from
the Data Adapter object.

I've tried to use the "Copy Project" option but can't get it to work -
I don't think my web host supports it, so I have to FTP everything
over.

Mark
Nov 18 '05 #3

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

Similar topics

2
by: Stan | last post by:
I need to change the Url property in a web service proxy class in a generic way. The proxy class looks like this public class Sender : System.Web.Services.Protocols.SoapHttpClientProtocol ... ...
0
by: Bill Johnson | last post by:
Server Error in 'DataGrid' Application Compilation Error CS0234: The type or namespace name 'Global' does not exist in the class or namespace 'System.Web.UI.WebControls.DataGrid' (are you...
3
by: George W. | last post by:
I'm trying to use a DLL in my web app and get CS0234 (Namespace error). Is there no way to use a DLL that was written in VB in a C# web app?? -George W.
1
by: Surjeet Gill | last post by:
I was getting the following error after compiling the C# source file with VS.NET 2003, Any help will be appreciated. Many thanks! Surjeet Gill Details: Compilation Error Description: An...
0
by: Nikhil Patel | last post by:
Hi all, I am having a problem adding a reference in an ASP.Net project. I have written a custom control using a Web Control Library project. I compiled this project and generated a dll. Now...
0
by: li.eddie | last post by:
Hi All, I'm new to ASP.NET and trying to create a Database application with MS Visual Web Dev 2005. In my project, I wrote a generic abstract class called DataAccessHelper.cs under App_Code folder...
1
by: jack | last post by:
I have created webform controls by following steps from one of the site. but when im placing the control on the form im getting below compiler error im not able to get what is this and tried a...
9
by: Davidhere40 | last post by:
Do I have to use a web reference to access use a remote web reference? I can't seem to just use the proxy generated by my web services project, because that one never calls the remote service, its...
7
by: =?Utf-8?B?QU9UWCBTYW4gQW50b25pbw==?= | last post by:
Hi, I have been using the code (some of it has been removed for simplicity) below to allow authenticated (using ASP.NET membership database) users to get a file from their archive area. It...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
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
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...

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.