小编Tho*_*hew的帖子

在尝试更新实体框架中的模型时,为什么我会收到"无法更新EntitySet,因为它有一个DefiningQuery ..."异常?

使用Entity Framework在LINQ to SQL的帮助下进行更新时,会抛出异常.

System.Data.UpdateException: Unable to update the EntitySet 't_emp' because it has 
a DefiningQuery and no <UpdateFunction> element exists in the   
<ModificationFunctionMapping>
Run Code Online (Sandbox Code Playgroud)

更新代码是:

public void Updateall()
    {
        try
        {


            var tb = (from p in _te.t_emp
                      where p.id == "1"
                      select p).FirstOrDefault();
            tb.ename = "jack";

            _te.ApplyPropertyChanges(tb.EntityKey.EntitySetName, tb);
            _te.SaveChanges(true);
        }
        catch(Exception e)
        {

        }
    }
Run Code Online (Sandbox Code Playgroud)

为什么我收到此错误?

asp.net-mvc entity-framework exception linq-to-sql

24
推荐指数
2
解决办法
2万
查看次数

将Adal JS与Office 365一起使用 - 在首次加载时使用多个Ajax调用

我正在使用Adal JS用O365验证我的Html应用程序.该应用程序已在Azure AD中注册.在使用devloper工具时,我注意到断点 $.ajax({多次出现(从Azure AD回调之后).这导致**的多次执行.done.我在认证中遗漏了什么吗?

$(document).ready(function () {

  (function () {
    "use strict";

    window.config = {
      subscriptionId: 'ID',
      clientId: 'ID',
      endpoints: {
        mailApi: 'https://outlook.office365.com'
      },
      cacheLocation: 'localStorage'
    };

    var authContext = new AuthenticationContext(config);

    var isCallback = authContext.isCallback(window.location.hash);

    authContext.handleWindowCallback();

    if (isCallback && !authContext.getLoginError()) {
      window.location = authContext._getItem(authContext.CONSTANTS.STORAGE.LOGIN_REQUEST);
    }

    var user = authContext.getCachedUser();
    if (!user) {
      authContext.login();
    }
    else {

      authContext.acquireToken(config.endpoints.mailApi, function (error, token) {
        if (error || !token) {
          console.log('ADAL error occurred: ' + error);
          return; …
Run Code Online (Sandbox Code Playgroud)

javascript ajax oauth office365 adal

7
推荐指数
0
解决办法
499
查看次数

Azure 存储静态网站错误 - 找不到资源或内容不存在

为了了解静态网站如何在 Azure 存储中工作,我创建了一个基本的 angular 应用程序并将 dist 文件夹中的文件上传到静态网站。但是当我尝试访问该 URL 时,我收到一条 404 错误消息,显示“请求的内容不存在”。

此外,我可以看到文件存在于$web路径下,但是当我单击文件 URL 时<azurestorageurl>/$web/index.html,浏览器会抛出错误消息“找不到资源”。

.在此处输入图片说明

azure azure-storage azure-storage-files

6
推荐指数
2
解决办法
6465
查看次数

MS Chart X轴标签重复-显示单个项目的多个点[范围栏]

我创建了一个与数据表绑定的RangeBar MS Chart控件。该数据表是根据以下列表数据创建的。问题是x轴显示了同一项的不同范围的多个点。

清单 在此处输入图片说明
MS图表的
X轴表示列表的第一列,Y轴的值表示第三列和第四列。“ dt”是数据表名称

在此处输入图片说明

chChart.Series["Series1"].ChartType = SeriesChartType.RangeBar;
chChart.Series["Series1"].Points.DataBind(dt.DefaultView, "Number", "Start Time,Stop Time","ToolTip=Name,Label=Name");
Run Code Online (Sandbox Code Playgroud)

尝试将绑定设为其他系列,但仍然无法正常工作。

  var IETable = (dt as System.ComponentModel.IListSource).GetList();
             chChart.DataBindCrossTable(IETable, "Number", "Number", "Start Time,Stop Time","");

                foreach (Series sr in chChart.Series)
                {
                    sr.ChartType = SeriesChartType.RangeBar;
                    sr.YValueType = ChartValueType.Time;

                    sr.XValueType = ChartValueType.String;


                }
Run Code Online (Sandbox Code Playgroud)

有没有一种方法可以对同一项目的x轴值进行分组,以使条形图在同一行中?
注意-使用自定义标签时,每个x轴标签仅显示一个值。

.net c# asp.net data-binding mschart

5
推荐指数
1
解决办法
2724
查看次数

VBA 中的错误 462:找不到远程服务器计算机

下面的代码是用vba读取word文件。但它显示错误

VBA 中的错误 462:未找到远程服务器计算机。

Sub abc()
    Dim fileReader As String
    Dim wrdApp As Word.Application
    Dim wrdDoc As Word.Document
    Dim singleLine As Paragraph
    Set wrdApp = CreateObject("Word.Application")
    Set wrdDoc = wrdApp.Documents.Open("C:\Documents and Settings\Administrator\My Documents\Downloads\fwfiles\webs.doc")
    With wrdDoc
        Dim p As Paragraph
        For Each p In wrdDoc.Paragraphs
            fileReader = p.Range.Text
        Next p
    End With
End Sub
Run Code Online (Sandbox Code Playgroud)

提前致谢

vba ms-word

4
推荐指数
1
解决办法
3万
查看次数

在用于Office 365的Angular JS App中使用Adal JS

我正在创建一个基本的HTML网站,使用Angular JS和Adal Js连接到Office 365.以下是面临的问题 -

  • 该页面不会重定向以进行登录.
  • 在浏览器控制台中出现"意外令牌"和"[$ injector:modulerr]"错误.

我在Azure AD中配置了以下详细信息 -

  • SIGN-ON URL:http:// localhost:端口号/
  • APP ID URI:https://租户名称/ ThomasO365
  • REPLY URL:http:// localhost:端口号/

    Exchange和SharePoint权限已提供给应用程序.

应用代码

var o365CorsApp = angular.module("o365CorsApp", ['ngRoute', 'AdalAngular']) // loading the ADAL JS Angular module


o365CorsApp.config(['$routeProvider', '$httpProvider', 'adalAuthenticationServiceProvider',

  function($routeProvider, $httpProvider, adalProvider) {
    $routeProvider
      .when('/', {
        controller: 'HomeController',
        templateUrl: 'index.html',
        requireADLogin: true
      })
      .otherwise({
        redirectTo: '/'
      });

    var adalConfig = {
      tenant: '<tentant name>',
      clientId: '<client id>',
      extraQueryParameter: 'nux=1',
      endpoints: {
        "https://outlook.office365.com/api/v1.0": "https://outlook.office365.com/"
      }
    }; …
Run Code Online (Sandbox Code Playgroud)

office365 angularjs adal

4
推荐指数
1
解决办法
1265
查看次数

如何在asp.net中显示viewdata中存在的名称列表

我在viewdata中有一个名称列表,但我无法在视图页面中显示它

<body>

    <%= ViewData["names"].ToString() %>
Run Code Online (Sandbox Code Playgroud)

谢谢

asp.net-mvc viewdata

2
推荐指数
1
解决办法
1699
查看次数

什么是Web应用程序或网站中的无状态状态

我只是学习Web应用程序开发的基础知识.正如我正在阅读不同的方法,如ASP.Net Web Forms,ASP.Net MVC等.在解释MVC和所有内容时,大多数教程都提到了"无状态"这个术语.我无法正确理解这个词.你能帮忙解释一下吗?

谢谢

asp.net-mvc webforms stateless

2
推荐指数
2
解决办法
3158
查看次数

无法在sharepoint中调试自定义计时器作业

我尝试了以下步骤来调试特定的自定义计时器(已安装并激活):

  1. 复制GAC中的两者.dll.pdb文件.
  2. 重新启动计时器服务.
  3. 附加两个w3wpOWSTimer.exe过程.

但调试仍未进行.放置的调试器是空圆圈,显示以下消息:

断点当前不会被击中.没有为此文档加载任何符号.

OWSTimer以diff用户名显示.是否需要从我的帐户运行?

为什么调试不起作用?

debugging sharepoint sharepoint-2007 timer-jobs visual-studio

2
推荐指数
1
解决办法
1万
查看次数

'激活功能'步骤错误:对象引用未设置为对象的实例

我创建了一个自定义计时器作业,并通过sharepoint中的功能事件实现了它.

当我试图激活它时,它显示了这个特殊的错误:

Object reference not set to an instance of an object.   at TimerJobExample.MyFeatureReceiver.FeatureActivated(SPFeatureReceiverProperties properties) in C:\Documents and Settings\admin-shuklag.INFRADEV\My Documents\Visual Studio 2008\Projects\TimerJobExample\TimerJobExample\MyFeatureReceiver.cs:line 22 
   at Microsoft.SharePoint.SPFeature.DoActivationCallout(Boolean fActivate, Boolean fForce) 
   at Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, Boolean fForce) 
   at Microsoft.SharePoint.SPFeatureCollection.AddInternal(Guid featureId, SPFeaturePropertyCollection properties, Boolean force, Boolean fMarkOnly) 
   at Microsoft.SharePoint.SPFeatureCollection.Add(Guid featureId) 
   at Microsoft.SharePoint.WebControls.FeatureActivator.BtnActivateFeature_Click(Object objSender, EventArgs evtargs) 
   at System.Web.UI.WebControls.Button.OnClick(EventArgs e) 
   at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) 
   at System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) 
   at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) 
   at System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) 
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 
Run Code Online (Sandbox Code Playgroud)

错误行在下面突出显示

public override void …
Run Code Online (Sandbox Code Playgroud)

sharepoint stsadm sharepoint-2007 timer-jobs

1
推荐指数
1
解决办法
1万
查看次数