SQL Server Reporting Service 2010 | Not working in Console app - c#

I want to list all the subscriptions made in the reporting server. For this I created a sample console application and added the reference of Microsoft.ReportViewer.WebForms.dll located in the
%Program Files(x86)%\Microsoft Visual Studio
11.0\ReportViewer\Microsoft.ReportViewer.WebForms.dll
But, when I am trying to create object of ReportingService2010 using the following
ReportingService2010.ReportingService2010 r = new
ReportingService2010.ReportingService2010();
It won't allow me to create the object, and throws a compile time error
error CS0246: The type or namespace name 'ReportingService2010'
could not be found (are you missing a using directive or an assembly
reference?)
Which ddl's I am missing here please help me.

Microsoft has a ReportViewer package that needs to be deployed (link below). Adding reference to the project from your development box may not be sufficient.
http://msdn.microsoft.com/en-us/library/ms251723.aspx

I believe the ReportingService2010 is not part of the reference Microsoft.ReportViewer.WebForms.
You need to add a web refrence to your project.
Here is a great tutorial from Microsoft, it shows you how to add a web reference to the SQL Server Reporting Web Service:
http://technet.microsoft.com/en-us/library/ms169926.aspx
If you follow these steps you should be able to use ReportingService2010 like this:
ReportingService2010 rs = new ReportingService2010();

Related

C# accessing a class when using codefile

I have a web application project, in visual studio 2017. We are using codefile, instead of code behind, on the server, so this project can be sheared with organisations who do not have visual studio.
Within the visual studio project, I have created a class, so I can reuse code on every page (to do with controlling who can access certain pages).
Therefore, on each web page, page_load event, I have the following code:-
generalFunctions objSecurity = new onlineCaseReporting.generalFunctions();
if (!objSecurity.userAllowedToAccessPage(pageFileName))
{
This works perfectly, within visual studio on my development machine but on the server, I get the following error:-
Compiler Error Message: CS0246: The type or namespace name 'generalFunctions' could not be found (are you missing a using directive or an assembly reference?)
I am assuming this is because I am using CodeFile and not supplying any DLLs. Is there a way to use classes when using CodeFile?
Thanks

What QuickBooks SDK 13.0 namespace is required to instantiate QBSessionManager?

I have downloaded QuickBooks SDK 13.0 and am trying to build a very simple C# application that connects to QuickBooks via QBSessionManager.
I am using Visual Studio Express 2013. I have the following lines of code in the Load function of my very simple Form.
QBSessionManager sessionManager = new QBSessionManager();
sessionManager.OpenConnection("", "Application");
When I try to compile, I get
The type or namespace name 'QBSessionManager' could not be found (are you missing a using directive or an assembly reference?)"
I see lots of sample code that starts with instantiating QBSessionManager, but nothing that identifes the namespace or reference I need to specify.
Am I missing something really obvious?
Add the file QBFC13Lib.dll to your project requirements.
The file can be found in the c:Program Files(x86)\Common Files\intuit\QuickBooks directory of a standard install of quickbooks.

c# namespace name cannot be found

I am trying to make an asynchronous client for Windows Phone using this code http://msdn.microsoft.com/en-us/library/bew39x2a.aspx in Visual Studio 2010 but I get 22 errors for using things like IPHostEntry and BeginConnect although I copied the code exactly. Any ideas?
Thanks
Edit
The three different types of errors I'm getting are below. most of them are the third one with sockets.socket
Error 1 The type or namespace name 'IPHostEntry' could not be found (are you missing a using directive or an assembly reference?)
Error 2 The name 'Dns' does not exist in the current context
Error 3 System.Net.Sockets.Socket' does not contain a definition for 'BeginConnect' and no extension method 'BeginConnect' accepting a first argument of type 'System.Net.Sockets.Socket' could be found (are you missing a using directive or an assembly reference?)
You may be missing a reference. Verify that the appropriate DLLs have been identified as project references.
You should check to see if your project is using the correct version of .Net. In .net 4.0 there is both a "client" and "full" version. Typically when you create a new .Net project in Visual Studio the project is created and referencing the "client profile" .net. Honestly, this gets me every time.
You can change this by doing the following (Visual Studio 2010):
Right click the project in Visual Studio Solution Explorer and select "Properties"
Make sure the "Application" tab is selected
View / Change the "Target Framework:" from ".NET Framework _ Client Profile" to ".NET Framework _"
rebuild your project :-)
Here's a good link explaining the difference between the client profile and the full profile: Differences between Microsoft .NET 4.0 full Framework and Client Profile
The code is missing a namespace before it is declaring classes.
namespace YourNamespace
{
// State object for receiving data from remote device.
public class StateObject { ...
Also you may be missing namespaces for stuff the code is using. Click on the classes that are highlighted with red squigglies and press ctrl + . and it should give suggestions for namespaces.
I encountered the same issue today. I think it's because VS2010 Express WP created my project using 2.0 .NET framework, I don't know why, I want to use 7.8, but I have only choice between 7.0 and 7.1. I can't change .Net framework version for use the 4.0/4.5, I have only one choice and it's windows phone 7.1, I can't choose the version of the framework separately...

nettiers data class library not recognized

I needed to make a console application using nettiers class libraries. I created a new Console Application project, added references to all the libraries from NetTiers and created an app.config file with all the necessary configurations. I get intellisense and no errors and everything when I am doing the coding, but when I go to compile the application, I'm getting an error that PPGEDI.Data doesn't exist.
I only have 1 line in the program.cs Main method:
PPGEDI.Entities.VansEntity van
= DataRepository.VansEntityProvider.GetById(16);
I'm getting the following error:
Error 93
The type or namespace name 'Data'
does not exist in the namespace 'PPGEDI'
(are you missing an assembly reference?)
It's frustrating, because I know I've added the assembly reference:
I'm using Visual Studio 2010, with C# and .NET 4.0. Can anyone give me an idea as to what I need to do to get this to work.
As a note, this works if I use the same statement in a method on an ASPX page in the web application generated by nettiers.
#BrokenGlass, you were absolutely correct. I double checked and it was
set to ".NET Framework Client Profile", I changed it to .NET 4 and
it's working now, can you put that as an answer?
You are using the .NET client profile in your console app which is a "minified" version that doesn’t contain all assemblies.
The problem is that when your app adds a reference to a class library that is targeting the full framework, references to the "full" framework assembly will not resolve. This results in the rather non-forthcoming error message that you see. Switching to the the full .NET 4 as target framework will resolve the issue.
For a more in depth overview of the problem and the .NET 4 Client Profile in general also see "What’s new in .NET Framework 4 Client Profile RTM"

Unable to access List using web reference in Sharepoint

I want to develop an application in C# which can access sharepoint data without any dependency to Windows Server Machine (Without using sharepoint dll). After adding reference to project I am unable to use this reference.
For example Web Reference name is: "MyServer". I am unable to use:
MyServer.Lists listService = new MyServer.Lists();
Showing error :
The type or namespace name 'MyServer' could not be found (are you missing a using directive or an assembly reference?)
How can i resolve this problem?
I think, the problem is that you have added a "service reference", not a SOAP web service web reference (see this article: http://alexduggleby.com/2008/08/24/add-web-reference-instead-of-service-reference-in-visual-studio-2008/)

Categories