How i can call winform from wpf window - c#

Here is the code in wpf window that is calling two winform :
(new TWSMIS.Customer.New_CustomerF()).Show();
(new TWSMIS.Voucher.Create_Dv_VouchersF()).Show();
Here project name is "TWSMIS" folder names are "Customer" and "Voucher" respectively .In this code only first line is giving error of :" The type or namespace name 'New_CustomerF' does not exist in the namespace 'TWSMIS.Customer' (are you missing an assembly reference?) C:\Users\SKJ\Documents\Visual Studio 2012\Projects\TWSMIS\TWSMIS\HomePage.xaml.cs" While second line is executing correctly .Can some body tell me how to correct this error?

Related

Object in ProjectReference not accessible when using 'Import'

In a simple project i want to reference objects from a webreference added to another c# library.
The Webreference is called QServices The default namespace is set as below
What seems to work is the following code:
Taskworkflow.SI.QServices.Record[] querysResult = new Taskworkflow.SI.QServices.Record[0];
yet when i import the Taskworkflow.SI - namespace, i keep on getting errors:
using TaskWorkflow.SI;
....
QServices.Record[] querysResult = new QServices.Record[0];
This results in the error:
The type or namespace name 'QServices' could not be found (are you missing a using directive or an assembly reference?)
Could someone clarify this for me?
Thank you for your time.
Note: QServices do only exist inside TaskWorkflow.SI. They do not have any occurences in other projects nor do they have any classes/namespaces/objects that share the name.
I strongly suspect that for whatever reason, you're ending up with a namespace called QServices declared in the TaskWorkflow.SI namespace. So actually you want:
using TaskWorkflow.SI.QServices;
....
Record[] querysResult = new Record[0];
Or you could explicitly alias it:
using QServices = TaskWorkflow.SI.QServices;
....
QServices.Record[] querysResult = new QServices.Record[0];

Type or Namespace Error

I have two references in my application. In the BAL code i am able to use the namespace "using TestDAL;"
But I am not being able to use the namespace of BAL in my .cs page. This is the error i get,
CS0246: The type or namespace name 'TestBAL' could not be found (are
you missing a using directive or an assembly reference?)
And one thing in my bin folder too I only have the TestDAL.dll file. How do I insert TestBAL.dll file?
Can anyone help me with what can be possible reason?
Thanks in Advance,
Try this:
Then, click browse and add your .dll file:
That should help you, if not please leave some feedback.
You could also try using alias for your namespace like this:
using namespaceAlias = TestBAL;
Create object of TestBAL objBAL = new TestBAL(); in your cs page. Check out, This codes gives any error or not.

CrystalReport's Section Does not have property of AddTextObject in VS2010 with CR13

Note: I am using CR13 with VS 2010.
I am creating winform app.I want to create report dynamically,
I got reference of one of link in which the guy had created report dynamically:
http://www.xtremevbtalk.com/archive/index.php/t-248952.html?
I want same thing but i couldn't. I have create my report's instance as
EmployeeReport empRpt = new EmployeeReport();
then want to add TextObject as like
empRpt.section3.AddTextObject("Print Date: ", 0, 890).
But VS2010 gives me error that:
Error 16 'CrystalDecisions.CrystalReports.Engine.Section' does not
contain a definition for 'AddTextObject' and no extension method
'AddTextObject' accepting a first argument of type
'CrystalDecisions.CrystalReports.Engine.Section' could be found (are
you missing a using directive or an assembly reference?
Any suggestions?
empRpt.Section(3).AddTextObject("Print Date: ", 0, 890")
^here

RazorEngine Razor.Parse(...) throws exception about ServiceStack and Markdown?

I ran this simple example from the website and I get the error below when it calls Razor.Parse. How can I fix this???
http://razorengine.codeplex.com/
string template = "Hello #Model.Name! Welcome to Razor!";
string result = Razor.Parse(template, new { Name = "World" });
error CS0234: The type or namespace name 'Markdown' does not exist in the namespace 'ServiceStack' (are you missing an assembly reference?)
Not sure why you've linked to http://razorengine.codeplex.com
The 'ServiceStack' error assumes you want to use the Markdown engine in ServiceStack in which case you should be referencing the RazorEngine.dll that comes with ServiceStack not the one in razorengine.codeplex.com if that's what is done here.
I would imagine one of two things has happened. Either in your configuration file, namespaces have been added within the <razorEngine> configuration section, or the AddNamespace method is being called somewhere to include namespace imports in the compiled template.
The net result, is that namespaces are added to the generated class file, but references are missing. RazorEngine will automatically reference any loaded assemblies in the AppDomain.

Compiler error:The type or namespace name 'Core' does not exist in the namespace 'System' (are you missing an assembly reference?)

I try to upload an image in my project which is in c#.and my code in the submit button is following
FileUpload1.SaveAs(
Server.MapPath("Photos\\" +
System.Core.WebSecurity.GetUserName(Request) + ".jpg"));
Response.Write(
"<html> <script> alert ( 'you have successfully uploaded' ); </script></html>");
Response.Redirect("studentcreated.aspx");
but on compiling it shows an error as
The type or namespace name 'Core' does not exist in the namespace
'System' (are you missing an assembly reference?)
.
Then i try to solve this by adding system.core to reference. But still it shows the same error. I am using vs2008 asp3.5.
Try this to get username: User.Identity.Name
EDIT:
Add this reference: using System.Web.Security;

Categories