Click here to Skip to main content
15,888,802 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I working on project on asp.net C# . i have login page 'Login.aspx'. this page does'nt have master page. i already create dboperation class. and this class using login page by creating object of dboperation class. It is working on localhost. then i upload this to my server. but it shows an error in 'Login.aspx' page.

The error is
Compiler Error Message: CS0246: The type or namespace name 'Dboperation' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 15: public partial class Login : System.Web.UI.Page
Line 16: {
Line 17:     Dboperation Db = new Dboperation();
Line 18:     string a = "Admin/Principal";
Line 19:     string s = "Students";

Please help me.
Posted
Updated 11-Sep-11 23:23pm
v2
Comments
Prerak Patel 12-Sep-11 5:24am    
Added pre tag for error.
AmitChoudhary10 12-Sep-11 5:25am    
Is Dboperation Class is in the same Namespace as Class Login?
ijaziju 12-Sep-11 5:34am    
i am using this class by creating an object of dboperation class.
eg:
Dboperation Db = new Dboperation();

Place the cursor over the word "Dboperation" in your code. Do you get a small red line? If so, hover the mouse over it, and open the dropdown that will appear. You will gets options from VS that will fix it.
If you don't, then Dboperation can't be found - you may have got the capitalization wrong, you may need to locate the DLL, or move the appropriate .cs file into the App_Code folder.
 
Share this answer
 
Comments
ijaziju 12-Sep-11 5:31am    
i not get any small red line on it.
it is working on localhost. but it can't work in server.
OriginalGriff 12-Sep-11 5:40am    
How are you transferring to the server?
OriginalGriff 12-Sep-11 6:03am    
I use it too, but you have to be careful - don't copy your development Web.Config! :laugh:
Is your Dboperation in a .cs file in the App_code folder? If so (and it probably should be) did you copy that as well?
ijaziju 12-Sep-11 8:01am    
dboperation class is in App_code folder.
OriginalGriff 12-Sep-11 8:37am    
If the class is in the App_code folder on the server, then:
1) Check the case very carefully - I know you know this, but VS is case sensitive and it is easy to make a mistake.
2) Check the Dboperation.cs file: Is there a namespace instruction?
3) In your login class code, try typing "Dbo" on a new line - what does Intellisense suggest?
Is the reference to namespace that contains class DBoperation missing in your code?
Also the class itself could be missing so make sure its none of the two.
 
Share this answer
 
I guess this Dboperation class lies within a different Namespace than Login. So, write it as :-

Namespace.Dboperation Db = new Namespace.Dboperation();

and reference the dll in which the Dboperation lies in within your Project.
 
Share this answer
 
v2
Comments
ijaziju 12-Sep-11 5:42am    
i use this solution but it repeat same error again
If your Dboperation class is in another assembly, make sure you deploy this assembly on your server when publishing
 
Share this answer
 
Comments
ijaziju 12-Sep-11 5:58am    
how to perform this?
Timberbird 12-Sep-11 6:02am    
I don't know how you deploy it, that's hard to tell :). Try putting this assembly in your site bin directory, or register it in GAC

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900