Asp.Net c# Window Application - c#

I'm creating an Windows Application for the database backup and I've already added the references in my projects.
But I got the error:
'System.Data.SqlClient.SqlError' does not contain a definition for
'Message' and no extension method 'Message' accepting a first argument
of type 'System.Data.SqlClient.SqlError' could be found (are you
missing a using directive or an assembly reference?)
I've already attached the screen shot of the error. Please help me with this issue. Thanks.

As stated in two of the errors, you are missing an assembly reference to System.Data. Add this at the top of your code file (outside of any class or method) as using System.Data; and that should resolve the problem.
Or, right click on the underlined code and use the context menu to automatically add the missing reference.

Related

Create / Update windows phone store app throw an error "Are you missing assembly refernce"

I have an application on store with the name of Sher o Shayari. Now I want to update that app with bit structure change. I add category screen and comment out code that is not related to new things.
I have screen MainPage.xaml. I comment out all xaml code and changed functionality of this screen. Changed code is working perfect in debug mode. but when I try to create store build for updating application then store build creation display an error.
Error 1 'sher_o_shayari.MainPage' does not contain a definition for 'Valentine' and no extension method 'Valentine' accepting a first argument of type 'sher_o_shayari.MainPage' could be found (are you missing a using directive or an assembly reference?)
Error 2 'sher_o_shayari.MainPage' does not contain a definition for 'Love_Poetry_Images' and no extension method 'Love_Poetry_Images' accepting a first argument of type 'sher_o_shayari.MainPage' could be found (are you missing a using directive or an assembly reference?)
I have removed methods "Love_Poetry_Images", "Valentine" from both mainpage.xaml and mainpage.xaml.cs.
so why I'm getting this error.
This error display for those event which are now comment out. I don't need those so I removed / Comment out from mainpage.xaml and mainpage.xaml.cs.
What would be the problem? is this due to my bit structure change or not.? How to resolve this.? Your assistance will be higly appreciated.
I got solution of this error.
I renamed MainPage.xaml to category.xaml.
Correctly added Namespace for category.xaml.cs.
Then again tried to create store build. this time no error display and I have submitted app successfully.
Note: Please keep your backup before doing this thing or deleting MainPage.xaml

System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'FChart'

I download FusionChart and try to use in my MVC4 application. When i tried the same in my application i met an error like this. How to solve this. Any one kindly help me. Thanks for advance.
Error is
System.Web.Mvc.HtmlHelper<dynamic>' does not contain a definition for 'FChart' and no extension method 'FChart' accepting a first argument of type 'System.Web.Mvc.HtmlHelper<dynamic>' could be found (are you missing a using directive or an assembly reference?)
You should add HtmlHelper.cs and change namespace as your project name. I am successfully add fusion charts in mvc4.
Please tell me if it is work or not

Compilation Error in ASP.NET mvc3

<div class="dateAdded">Article submitted #article.DateAdded.ToRelativeDateStringUtc()</div>
Compiler Error Message: CS1061: 'System.DateTime' does not contain a definition for 'ToRelativeDateStringUtc' and no extension method 'ToRelativeDateStringUtc' accepting a first argument of type 'System.DateTime' could be found (are you missing a using directive or an assembly reference?)
Here is where my error is occurring. I have a class that contains ToRelativeDateStringUtc() included in my program. Is this a MS class that I have to import? I do not see it listed anywhere in the .net reference list. I'm sure its something simple, does anyone have any ideas?
I have already added the folder to my webconfig that includes the class, which contains the method the program is "missing". So its not missing it... I just dont know what else to do from here.
There are several things you could try.
Firstly, you can try the using directive inside the view you use this in:
#using Your.Namespace.Where.Extension.Class.Is.Located
Secondly, the web.config you've added the namespace to is probably the global one. If this view is inside an Area.. try putting the namespace into the web.config that is inside that particular area.
The first one will work regardless.

Unknown namespace during build (but intellisense knows it)

I am currently working on a project with SignalR. On my production server, it is missing an automatically generated js-file in ~/signalr/hubs.
I wanted to try this solution:
SignalR not working on production server
But when I try to add this line to my application_start method in global.asax, my project will not build anymore. Although intellisense knows and suggests the extension method!
I referenced the namespace with using SignalR;. I tried calling it as an extension method and calling it as a static method with the object instance as the first parameter.
The exact error messages:
When calling as extension method:
Error 1 'System.Web.Routing.RouteCollection' does not contain a definition for 'MapHubs' and no extension method 'MapHubs' accepting a first argument of type 'System.Web.Routing.RouteCollection' could be found (are you missing a using directive or an assembly reference?)
When calling as static method:
Error 1 The type or namespace name 'RouteExtensions' does not exist in the namespace 'SignalR' (are you missing an assembly reference?)
Anybody knows why this happens and how to solve the problem? Many thanks in advance!
I'm pretty sure that it could be one of these reasons:
Your project requires a reference to an assembly that's not added to the project.
Is your project using the .NET Framework version that's compatible with the referenced assembly?
With your given info, it would be hard to determine the exact reason, but I believe that I provided you some helpful hints.
The fact that intellisense suggests you anything like an extension method won't mean that the project has the required references to work properly.

ManagementBaseObject not found

Hi I'm having a problem implementing this method.
I have added using System.Management but the class still doesn't work.
The error is:
Error 7 The type or namespace name 'ManagementBaseObject' could not be found (are you missing a using directive or an assembly reference?)
You are probably missing the assembly reference to System.Management.dll. The using statement just brings names into scope, to save you typing the prefix: it doesn't actually add a DLL reference.
Right-click your project's References folder and choose Add Reference. Go to the .NET tab of the resulting dialog, select System.Management and click OK.
did you add System.Management.dll as a reference?
msdn tells us more about where to find ManagementBaseObject:
Namespace: System.Management
Assembly: System.Management (in
System.Management.dll)
Don't Forget to write using System.Management; after adding the reference some time this happens even after adding the respective assembly it shows the error.

Categories