.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

Unable to update EntitySet

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :ASP.Net

I have tables Events and Visitors with relation many-to-many. I had such error: Unable to update the EntitySet 'Events_has_Visitors' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.

I found similar problem at the Weblog of Ken Cox but it doesn't solve my problem. When I set primary key at Events_has_Visitors table and update Entity Model for some reason relation becomes 0..1 to *, but if I'll delete primary key - relation will become many-to-many again. But still doesn't work.

View Complete Post

More Related Resource Links

Help?! Unable to update the EntitySet because it has a DefiningQuery


Hi all-

Getting the following error and having trouble resolving it:

Unable to update the EntitySet 'ProfileSkill' because it has a DefiningQuery and no <InsertFunction> element exists in the <ModificationFunctionMapping> element to support the current operation.

This is occurring when I try to save an entity... basic db structure is Profile table with a joining table ProfileSkill that connects to Skill. ProfileSkill has two foreign keys, one to each table it joins on, which together form a unique key for the table. The EF modeler displays this as a many to many relationship and obscures the ProfileSkill table.

Googling the problem suggested I remove the DefiningQuery section of the edmx files for ProfileSkill, so I did this:

          <EntitySet Name="ProfileSkill" EntityType="TAPSpaceModel.Store.ProfileSkill" store:Type="Tables" store:Schema="dbo" store:Name="ProfileSkill">
      [ProfileSkill].[ProfileId] AS [ProfileId], 
      [ProfileSkill].[SkillId] AS [SkillId]
      FROM [dbo].[ProfileSkill] AS [ProfileSkill]</DefiningQuery>-->

That results in a different error:


Unable to write anything when Update Progress Close

Hi,Acctually I have done lots of coding on Page_Load of a page which comming from other page. So for that i tried to use ModalPopupExtender. but problem is that its working fine for button but how can i use it for Page_Load.My scenario is:protected void Page_Load(object sender, EventArgs e)    {        PleaseWaitPopup.Show();        //Lots of code and queries;       PleaseWaitPopup.Close();          }  After too much googling i found one solution. which works but still problem is after closing ModalPopupExtender I am unable to write anything on page even i have removed StyleSheet:Current Code is as Follow:<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %><%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server">    <title></title> <link href="StyleSheet.css" rel="styles

Unable to update records using IN clause

Hi, I've a common function as shown below: public int ExecuteNonQuery(string text, params IDataParameter[] parameters) { DbCommand command = new SqlCommand(); command.CommandText = text; command.CommandType = type; command.Connection = conn; command.Transaction = null; foreach (IDataParameter parameter in parameters) { command.Parameters.Add(parameter); } return command.ExecuteNonQuery(); } public IDataParameter CreateParameter(string name, object value) { if (!name.StartsWith("@")) name = "@" + name; DbParameter parameter = new SqlParameter(name, value); if (value == DBNull.Value) parameter.IsNullable = true; return parameter; }  When I want to update records in a table, I usually invoke as shwon below:// Assume you've a connection object IDataParameter param = conn.CreateParameter("vendor_id", vendorId); string query = "UPDATE table SET status=4 WHERE vendor_id = " + param.ParameterName; conn.ExecuteNonQuery(query, param); This code works fine. But when I'm trying to update multiple records using IN clause, it does not work. Can any one tell me how to do it using IN clause? I need to update all vendors ava

Unable to update Work E-Mail in My Setting of Sharepoint 2010

Hey,   i am trying to update Work E-mail in My settings but it will not allow me to edit.   when i click on Edit Items then Attach file comes as user personal information   Please suggest me solution.   Regards, Sachin Phapale  

Unable to Set Control's Property After Update / PagePostBack


I'm trying to programmatically set the property of a control on my Form AFTER I've proccessed an update command using the FormView, but it's not working. 

In my example below, I have a basic FormView with only a TextBox and Label in its EditItemTemplate.  The FormView uses an AccessDataSource.  The TextBox is bound to the datasource, but the label is not.  What I'm trying to do is update the value in the TextBox (as well as its associated data stored in the database), and then change the Text property of the Label. (*Note: that I using the label purely as an example. The point is I can't see to set any control's property after an update).

I initally thought it had something to do with the "Page.IsPostBack", but even after trying to adjust my code for that, its still not working.

I've tried change the Text property during the Page.IsPostBack during Page_Load event. I've tried setting the Label's EnabledViewState property to True and to False. I've tried using the FormView's OnItemUpdating and OnItemUpdated events. I've tried using the DataSource's OnUpdating and OnUpdated events.

Nothing seems to work. Any suggestions?

Here's my sample code and Html:

<script language="VB" run

unable to update data to databse from grid view


I have two tables in my database

using "innerconnect" i have show table content in grid view as      INV_NO            INV_DT        DN_NO       DN_DT   LR_NO        LR_DT .

where LR_NO is null .

I want to update it from grid view plz help


here  DN_NO  and INV_NO are primary keys

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace amar
    public partial class Form2 : Form
        SqlConnection con;
        SqlDataAdapter da1,da2;
        SqlCommandBuilder cb;

Unable to Edit & Update user Profile Information

I Have a sharepoint Site.. I am trying to configure alter in the site..But Email ID are not available bel for all the users..I tried to Update the user Profile info by clicking the edit Item button in the user profile information.But it is not showing any editable content...It is just showing user NTlogin?This site is not connected to active directory.. We are adding users manually..How to update user details?

iis 7 IP Security using System.DirectoryServices : Unable to update


I used the below code to Set  IP Security from my vb.net Application.  It is working in IIS 6 (windows xp, and server 2003).

facing error in IIS 7.5 (windows7).

' Get the IIS object that holds the info for the default site.


Dim SecObj As Object = GetObject("IIS://LocalHost/W3SVC/1/Root/WebServerSCM")


' Get the IIsIPSecurity object.

System.Windows.Forms.WebBrowser unable to update or change


I am using this WebBrowser component in a C# project.

I have declared and use "_wb" as shown below::

string httpcmd = @"https://...........";

System.Windows.Forms.WebBrowser _wb = new System.Windows.Forms.WebBrowser();                
_wb.ScriptErrorsSuppressed = false;                
Uri myuri = new Uri(httpcmd);
_wb.Url = myuri;
while (_wb.ReadyState != System.Windows.Forms.WebBrowserReadyState.Complete)


The above code in within a class.

Once my program uses the above code once, it then does seem possible to change.

i.e. After the first iteration, nothing changes each time the code is run.

The DocumentText property I reference stays the same once it is set.

It is like the URI is not even re-sent.

Only if I close the application and then re-run then the webbroweser will update as desired.

I have seen many references to this problem but have not been able to resolved it.

Can anyone suggest how to get this componet to reset or clear so it behaves like I have re-run the application?


Unable to request Cumulative Update or any hotfix


I need to install the Feb 2010 CU for SharePoint 2007 (x86). This is KB978395. When following the link to request the hotfix, I am presented with the error message "The system is currently unavailable. Please try back later, or contact support..." I have tried accessing for several days. Have checked firewall settings, turned off anti-virus. Tried using Windows 7, Windows Server 2003, IE8, Firefox, Chrome - all with the same result. Although this particular update is what I need (to get a development VM to the same build number as a client's production system for troubleshooting a problem), ANY hotfix request returns the same error. I am in New Zealand, but have used this service fine in the past. The specific URL in question is http://support.microsoft.com/kb/978395 (but any hotfix request has the same problem). A search on the error message shows other people routinely have the same problem.

Any help would be appreciated.

unable do item.update for SPDocument library



I have the following code to attahe the file and update the item fields for a document library , hoever the item.update is throwing exception as "use SPFIlecollection.add to add file to documetn library " adn my values for Library fields are not getting updated.



public override void EmailReceived(SPList list, SPEmailMessage emailMessage, string receiverData)


        //Declaration Of Variables.

        string strTo = ""; string strSubject = ""; string strBody = ""; string strCC = ""; string strFrom = ""; string strCreatedBy = ""; string strI

Unable to update the information in the Microsoft Office Document libraryname/documentname.xls

Hi, one of our users is facing this particular issue, he is able to upload excel files to other libraries/sites
he has Office 2007 installed, IE7, Windows XP,
the document is saved in 2003 version, he is able to upload same document on other libraries,
but whenever he tries to upload to this particular library he gets the following exception

Server Error in '/' Application

description: an unhandled exception ocurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

exception details: System.Runtime.InteropServices.COMExcetion: Unable to update the information in the Microsoft Office document LibraryName/documentname.xls

Stack Trace
[COMException (0x81071003): Unable to update the information in the Microsoft Office document LibraryName/documentname.xls]
Microsoft.SharePoint.Library.SPRequestInternalClass.AddOrUpdateItem(String bstrUrl, String bstrListName, Boolean bAdd, Boolean bSystemUpdate, Boolean bPreserveItemVersion, Boolean bUpdateNoVersion, Int32& plID, String& pbstrGuid, Guid pbstrNewDocId, Boolean bHasNewDocId, String bstrVersion, Object& pvarAttachmentNames, Object& pvarAttachmentContents, Object& pvarProperties, Boolean bCheckOut, Boolean bCheckin, Boolean bMigration, Boolean bPublish) +0


Unable to Manage Content Files During Program Update/Redeployment


I am attempting to include new versions of my Content Files with newer versions of the application. The initial install works as expected and further changes to the program code (Primary Output) update as expected when adjusting the AssemblyVersion.

My problem is that I have not had any success updating or affecting the Content Files placed during the initial install. Currently, I include two different SQL Server 2008 database files (.mdf). My goal is to have program updates replace ONE of the database files while leaving the other one unaffected.


My Research (sorry, I don't have specific links that I have used already)

I have looked around on Google and MSDN trying to find the procedure to manage these Content Files. The closest level of information I found was a comparison that the installer would use on the Last Updated Date of the "new" file and the "old" file. I attempted to manipulate this by changing the clock but neither database file was changed on the update.

It seems this would be handled easily if there were a File Version associated with the database files, but I haven't found any properties or web searches that indicate this.

My Question How do I manipulate specific Content Files to be included with a program update/redeplo

Unable to extract SQL Server 2008 SP1 Cumulative Update 2 executable.



Requested the SQL Server 2008 SP1 CU2 hotfix and got an email with the location (see below) and password.

KB Article Number(s): 960616, 961106, 961760, 961811, 963061, 965217, 967206, 967337, 967561, 967983, 967984, 968085, 968290, 968449, 968834, 968900, 969007, 969131, 969235, 969362, 969469, 969588, 969775, 969872, 970070, 970184, 970198, 970255, 970315, 970461, 970550
Language: All (Global)
Platform: x64
Location: (http://hotfixv4.microsoft.com/SQL%20Server%202008/sp1/SQL_Server_2008_SP1_Cumulative_Update_2/10.00.2714.00/free/381569_intl_x64_zip.exe)

Ran the executable  381569_intl_x64_zip.exe and get prompted for the password.    Doesn't accept the password supplied in the same email.    No error, just nothing happens and nothing is extracted.

Password is 6 characters long and starts with a pound sign (#).

Trying the download again after a second request.    Noticed the password is the same.

Any ideas?


ASP.Net Gridview Edit Update Cancel Commands

In ASP.Net 2.0, GridView Control also provides the functionality to edit and update the data retrieved from the database using CommandField template. You can cancel the action using Cancel Command of the CommandField. GridView consists of events that can be used to perform the actions like edit, update and cancel upon the Data items displayed in the ASP.Net GridView Data Control.

How to format and update GridView and DataGrid rows using JQuery

The behavior described in this question is as expected. When you set text of a cell in grid, it directly affects HTML that is going to be rendered. When you set text value of a cell, it means that you are setting innerText of the cell. The column that GridView creates for command fields (Edit, Delete and Select) are a (anchor) or button elements. So you can see what will happen if you set text value in that cell. It will wipe out those link or button controls and replace them with simple text string.

Update Vs SystemUpdate

Many of you might noticed that share point ListItem has Update() method as well as SystemUpdate().

What is the difference between these two methods and why MOSS has two different APIs for updating an ListItem
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