Error occured:”Event Receivers”,SPUsercodev4 cannot run on your computer

When iam trying to deploy an event receiver to sharepoint web application i am getting the error “SpUserCodev4” cannot run on your computer.

From Central Admin->Security-> Configure Service Account I selected the Windows Service – Microsoft SharePoint Foundation Sandboxed Code option from the drop down and added my newly registered account (Lets say SP2010_Sandbox).

**Note**

You must change the service account assigned to the service before starting the Sandboxed Code Service (This makes life a lot easier!)

clip_image001

After configuring the service account for Sandbox I navigated to Central Admin->Application Management->Manage Services on Server and started the service. From here everything looks fine and the service indicates started.

clip_image002

Advertisements
Posted in Uncategorized | Leave a comment

Visual studio 2010 Client object model error “The type or name space name ‘SharePoint’ does not exist in the name space ‘Microsoft’ (are you missing an assembly reference?)”

Change the framework 4.0 to frameworkwork 3.5

Posted in Uncategorized | Leave a comment

How to change the VSTA coding language and Full Trust

To change the VSTA Language and Enabling Full Trust

This can be done from Form Options or from the Developer-Language ribbon 

Developer Ribbon

Image

Posted in Uncategorized | Leave a comment

Infopath 2010 form binding data to dropdownlist from web service

A short code snippet to get the data from the web service and binding to dropdownlist.

First of all create a web service that returns a data set ,create a dataconnection from infopath that retrieves data from web service and binding data source to drop down list.

 

1) Creating web service

[WebMethod]
public DataSet RegCust()
{
string returnstr = “Insert failed”;
SqlConnection dbConn = new SqlConnection(“database=ims;server=192.168.0.111;uid=sa;password=@System”);
string sqlstr = “select productid,productname,unitprice,numofitems,TotalAmount from tblorderdetails”;
SqlCommand dbComm = new SqlCommand(sqlstr, dbConn);
try
{
dbConn.Open();
SqlDataAdapter da = new SqlDataAdapter(dbComm);
ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
returnstr = “Insert succeeded”;
}
returnstr = “Insert succeeded”;
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
dbConn.Close();
return ds;
}

Debug this and copy the URL:http://localhost:1983/getCompanyName.asmx

Image

2)Create dataconnection to retrive data from web service using infopath 

Steps:1) Click on “Data-Data Connections” from top ribbon

Image

2)Add a new connection from the DataConnections wizard

Image

3) Select operation Retrive 

Image

4)Select a source type,since it is a web service..we select first option

Image

5)Get the web servie details using the URL Copied from the above stepImage

7)Select the method that returns datasetImage

8)Clcik next and next

 

Binding Data Source to DropDownList

1)Right click on the drop down list and select “drop down list properties” and select “Get choices from the external data sources”

Image

 

2)Select the field that you want to display in the drop down list as follows

Image

3)Preview to see the output

Posted in Infopath 2010 | 1 Comment

Infopath 2010 form binding data to dropdownlist from web service

A short code snippet to get the data from the web service and binding to dropdownlist.

First of all create a web service that returns a data set ,create a dataconnection from infopath that retrieves data from web service and binding data source to drop down list.

 

1) Creating web service

[WebMethod]
public DataSet RegCust()
{
string returnstr = “Insert failed”;
SqlConnection dbConn = new SqlConnection(“database=ims;server=192.168.0.111;uid=sa;password=@System”);
string sqlstr = “select productid,productname,unitprice,numofitems,TotalAmount from tblorderdetails”;
SqlCommand dbComm = new SqlCommand(sqlstr, dbConn);
try
{
dbConn.Open();
SqlDataAdapter da = new SqlDataAdapter(dbComm);
ds = new DataSet();
da.Fill(ds);
if (ds.Tables[0].Rows.Count != 0)
{
returnstr = “Insert succeeded”;
}
returnstr = “Insert succeeded”;
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
dbConn.Close();
return ds;
}

Debug this and copy the URL:http://localhost:1983/getCompanyName.asmx

Image

2)Create dataconnection to retrive data from web service using infopath 

Steps:1) Click on “Data-Data Connections” from top ribbon

Image

2)Add a new connection from the DataConnections wizard

Image

3) Select operation Retrive 

Image

4)Select a source type,since it is a web service..we select first option

Image

5)Get the web servie details using the URL Copied from the above stepImage

7)Select the method that returns datasetImage

8)Clcik next and next

 

Binding Data Source to DropDownList

1)Right click on the drop down list and select “drop down list properties” and select “Get choices from the external data sources”

Image

 

2)Select the field that you want to display in the drop down list as follows

Image

3)Preview to see the output

Posted in Infopath 2010 | Leave a comment

Using Web Templates to create Site Collections using solution package from visual studio 2010

Please follow the link http://sharepointchick.com/archive/2011/02/10/using-web-templates-to-create-site-collections.aspx

Posted in Uncategorized | Leave a comment

How to modify the site url while creating a sharepoint sandboxed solution or farm solution

Inorder to modify the site url later while writing the sandboxed or farm solution,open properties window of the project ,their you can find many properties like Site URL,Sandboxed Solution and on..

Posted in Uncategorized | Leave a comment