.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Is there a way to contrain or rest the scope that a activity has access to?

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :Windows Application
What I want to do is build a sequence activity that A) has its own scope and B) does not let child activities gain access to scope outside of its own.Is this possible?

View Complete Post

More Related Resource Links

Database Access Using SOAP and REST Web services

Hi Guys, Can anyone post the links regarding DATABASE ACCESS USING BOTH WEB SERVICES. How to query the database using the web service. Suppose i have SQL statement like " Select empID,empName,CName from employee,company where empID=CID;".  How to  send this sql query to database server using REST and SOAP web Services?  Thank You

Correct Changes to WCF REST 4 APIKEY Sample for SSL Access

I am working with the wcfrestservicewithkey sample template for rest 4.  Taking the sample as is, its web.config is below.  What are the correct tweaks to this simplified config such that the rest service is available via an ssl connection? Thx! <?xml version="1.0"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0" /> </system.web> <system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </modules> </system.webServer> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior> <!-- This behavior enables API Key Verification --> <serviceAuthorization serviceAuthorizationManagerType="WCFRestServiceWithKey1.APIKeyAuthorization, WCFRestServiceWithKey1" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpoint> <!-- Configure the WCF REST service base address via the global.asax.cs file and the default endpoint

How can i access to params and args defined in parent activity from custom NativeActivity


There is a scenario that the custom NativeActivity need to access to params or args defined in parent activity. What i have done as below

 protected override void Execute(NativeActivityContext context)


   WorkflowInstanceProxy proxy = context.GetExtension<WorkflowInstanceInfo>().GetProxy();

   Activity root = proxy.WorkflowDefinition;

   Activity rootChild = WorkflowInspectionServices.GetActivities(root).ElementAt(0);

   EditingContext ec = new EditingContext();

   ModelTreeManager mtm = new ModelTreeManager(ec);


   ModelItem modelItem = mtm.Root;

   ModelProperty c1 = modelItem.Properties["Variables"];

   ModelItemCollection c2 = c1.Collection;

   dynamic c3 = c2[0].GetCurrentValue();

   string value = c3.Get(context);


Apparently it is not possible to access to external params with local context so the error prompt "An activity can only access its own implementation variables."

My question is how to get it ? Is there another easy way to do so ?



be together be stro

Access is denied error thrown in "Setup Secure Session" activity


Could someone help me with the following issue, please?

System setup:
- Windows 2008 R2 server hosting both MVC2 web application and WCF service for it;
- users connect to the web application which gets all data from the WCF services;
- WCF services are resused by several other applications (WinForms based) which work fine and have never experienced any security related problems;
- MVC2 uses impersonation (<identity impersonate="true"/>) to connect to WCF services, so we have single security boundary for both web and winforms clients (which are out of scope of the problem);
- both MVC2 web application and WCF services share the same ASP.NET v4.0 DefaultAppPool application pool, running under NetworkService identity;
- all users, user PCs and servers belong to the same AD domain, which is a part of global corporate tree;
- all unhandled exceptions are automatically caught by the web application and forwarded to application developers' e-mail box;
- WCF binding setup in web application:

    <binding name="WSHttpBinding_BifrostServices" closeTimeout="00:10:00"
     openTimeout="00:10:00" receiveTimeout="00:10:00" sendTimeout="00:10:00"

Access Database through WCF REST



i created a service like this

  [OperationContract (Name = "GetAllCustomer")]
        [WebInvoke(ResponseFormat = WebMessageFormat.Json,
            BodyStyle = WebMessageBodyStyle.Wrapped,
        Customer[] GetAllCustomer();

 public class Customer
        public int CNo { get; set; }
        public string CName { get; set; }

  and access my db in service.svc.cs

 List<Customer> lstEmp = new List<Customer>();


 String connString = ConfigurationManager.ConnectionStrings["connWebOrdering"].ConnectionString;
            SqlConnection sqlConn = new SqlConnection(connString);

           SqlDataAdapter da = new SqlDataAdapter("Select [cid], [cname] from [CustomerDB].[dbo].[contact] ", sqlConn);
            DataSet ds = new DataSet();

Android could not access REST service

 public bool CreateCustomer(StringBuilder strObj)
//here i insert the data.. 
//i deserialize the incoming json format to my class object and insert into db

this method i can access using asp.net but not by using a android.. i have checked for the headers etc.. the response is OK in android while debugging but the data is not inserted..

what is the equivalent of stringbuilder in android??

in android i use

StringEntity se = new StringEntity(json.toString());

//and post the data to my service...


what is the equivalent of stringentity in C# and what can i do for this prob?

Android could not access REST service

  1. public bool CreateCustomer(StringBuilder strObj)   
  2.         {   
  3. //here i insert the data..    
  4. //i deserialize the incoming json format to my class object and insert into db   
  5. }  
  6. this method i can access using asp.net but not by using a android.. i have checked for the headers etc.. the response is OK in android while debugging but the data is not inserted..

    what is the equivalent of stringbuilder in android??

    in android i use

    StringEntity se = new StringEntity(json.toString());//and post the data to my service...


    what is the equivalent of stringentity in C# and what can i do for this prob?

!< Ganesh >! Do not tell the world whom you are...Show it... !!

Is it possible to access ExecutionProperties in a code, or asyncode activity?


I notice that the contect in these doesn't have an executionProperties property.  I keep havind to convert activities across to native just for this feature.

Is there a way to access this?

Jason Bolstad

Using the Excel Services REST API to Access Excel Data in SharePoint Server 2010 (Visual How To)

Learn how to use the REST API to retrieve resources such as ranges, charts, tables, and PivotTables from workbooks stored on SharePoint Server 2010.

Video: Using the Excel Services REST API to Access Excel Data in SharePoint Server 2010 (Visual How

Watch a short video that shows how to programatically retrieve data from an Excel workbook.

MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

'Model' cannot be declared in this scope


I have a complex partial view (ugly stuff), the view page has this line:- 

<% Html.RenderPartial("PartialIndicatorWeighting", indicator);%>
and inside the ugly partial view I have this,
<td><%: Model.Active %><%: Html.CheckBoxFor(Model => Model.Active)%></td>
I'm trying to display a list of checboxes to show if the item is active or not, I get the following error:-
A local variable named 'Model' cannot be 

Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

Disallow Direct Access To Files



Here is my dilema, on my site i have a WordPress Audio player (http://wpaudioplayer.com/standalone) that plays my mp3's.

It loads the Mp3's in by javascript...example below:

       AudioPlayer.embed("audioplayer_7", { soundFile: "/Files/Music/[name of file].mp3" });

This file name is clearly visible in the browser source. Not a problem, however this means that any user can legitimately browse to the file directly and download it.

Now i still need the mp3 player (which is flash) to have access to the file but if a user was to try accessing the file directly, they would not be allowed access to it.

I am not sure how to go about this, i am circling the idea of a httphandler but not sure if this is sufficiant to stop the direct access to the file.

Any help would be appreciated

How to access a new database ( which i created ) in isqlplus ?



I created a new database with the help of Database Configuration Assistant !

I created with the scott account

Now i'm not able to connect to the database with the connect identifier with the scott account

The error i get is.,

ERROR - ORA-12154: TNS:could not resolve the connect identifier specified.

Plz help !

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend