小编Joe*_*ter的帖子

EntityFramework.dll中出现未处理的"System.TypeInitializationException"类型异常

我正在尝试使用本教程学习Entity FrameworkSQLite.但是,我收到一个错误.

抛出的错误是:

EntityFramework.dll中出现未处理的"System.TypeInitializationException"类型异常

附加信息:'System.Data.Entity.Internal.AppConfig'的类型初始值设定项引发了异常.

这是完整的错误跟踪:

System.TypeInitializationException: The type initializer for 'System.Data.Entity.Internal.AppConfig' threw an exception. ---> System.Configuration.Configuration
ErrorsException: Configuration system failed to initialize ---> System.Configuration.ConfigurationErrorsException: Only one <configSections> element allowed per config file and if present must be the first child of the root <configuration>
element. (C:\Users\Ankur\Documents\Visual Studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.config line 11)
   at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal)
   at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors)
   at System.Configuration.BaseConfigurationRecord.ThrowIfInitErrors()
   at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
   --- End of inner exception stack trace ---
   at System.Configuration.ClientConfigurationSystem.EnsureInit(String configKey)
   at …
Run Code Online (Sandbox Code Playgroud)

.net c# sqlite entity-framework

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

如何在node.js中执行hello world javascript文件

我的hello_world.js文件位于我的电脑上,位于以下位置 -

C:\Users\Ankur\Downloads\NodeJS\working
Run Code Online (Sandbox Code Playgroud)

它有以下代码 -

console.log("Hellow World");
Run Code Online (Sandbox Code Playgroud)

我在这里阅读初学者教程,它说我应该通过node.js执行我的javascript文件.现在我不知道该怎么做.我该怎么做

我这样做的时候...... 在此输入图像描述

我一无所获.我应该怎样做才能成功运行hello world.这些教程似乎都没有显示需要完成的任务.

我对此非常陌生,所以对你们来说这可能是非常明显的.

javascript cmd node.js

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

Jquery无法使用Google CND

我刚开始创建一个html文件,并想使用jquery.当我像这样使用本地机器上的jquery时,它工作正常.

<script src="jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)

但是当我尝试使用它时,它不起作用

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
Run Code Online (Sandbox Code Playgroud)

当我像这样加载脚本时,我无法使用任何jquery函数.

我在这做错了什么?

编辑:顺便说一下,我的html文件在驱动器C的本地机器上:/

jquery cdn

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

为什么保存对数据库的更改失败?

我在控制台应用程序中有以下C#代码.

每当我调试应用程序并运行query1(将新值插入数据库)然后运行query2(显示数据库中的所有条目)时,我可以看到我插入的新条目清楚.但是,当我关闭应用程序并检查数据库中的表(在Visual Studio中)时,它就消失了.我不知道它为什么不能保存.

using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlServerCe;
using System.Data;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                string fileName = "FlowerShop.sdf";
                string fileLocation = "|DataDirectory|\\";
                DatabaseAccess dbAccess = new DatabaseAccess();
                dbAccess.Connect(fileName, fileLocation);

                Console.WriteLine("Connected to the following database:\n"+fileLocation + fileName+"\n");
                string query = "Insert into Products(Name, UnitPrice, UnitsInStock) values('NewItem', 500, 90)";
                string res = dbAccess.ExecuteQuery(query);
                Console.WriteLine(res);

                string query2 = "Select * from Products";
                string res2 = …
Run Code Online (Sandbox Code Playgroud)

.net c# sql-server-ce

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

PHP - 如何加载HTML文件?

目前我有这样的文件

<?php
if(some condition)
{
    //Dont allow access
}
else
{
    echo "<html>My HTML Code</html>";
}
?>
Run Code Online (Sandbox Code Playgroud)

但我想做这样的事情来保持我的PHP文件简洁.

<?php
if(some condition)
{
    //Dont allow access
}
else
{
    //print the code from ..html/myFile.html
}
?>
Run Code Online (Sandbox Code Playgroud)

我怎样才能做到这一点?

html php

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

在win 8 app中找不到"Search Pane"元素

我正在尝试在visual studio 2012中开发一个win 8应用程序,它实现了搜索合同.为了启用搜索功能,我添加了"搜索窗格"元素.但在运行应用程序时,我得到一个例外

"Element not found. (Exception from HRESULT: 0x80070490)"
Run Code Online (Sandbox Code Playgroud)

代码 -

this.searchPane = SearchPane.GetForCurrentView()
Run Code Online (Sandbox Code Playgroud)

任何人都可以告诉我这是什么问题和解决方案.

c#

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

AS3中的Foo是什么?

我已经多次看到它像AS3:如何将Vector转换为数组并且从未真正在任何教程中学到它.

甚至在谷歌搜索并没有得到任何结果 - http://www.google.co.uk/search?hl=en&q=Foo+in+AS3&meta=

它是某种我失踪的对象或变量类型?

或者是某些外部库带来的东西?

当我用Foo编译我的代码时,我得到了

Type was not found or was not a compile-time constant: Foo.
Run Code Online (Sandbox Code Playgroud)

谢谢

flash actionscript-3

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

像Canvas中的时间轴一样Flash

我正在寻找创建一个动画电影,但我没有使用Flash,而是使用HTML5画布.

在Flash专业版中,有一个很好的时间表,可以很容易地创建动画.单独的动画片段有单独的时间表.

是否有任何框架/库可以在HTML5画布中的环境中工作?

如果没有,在HTML5画布中创建动画电影的最佳方法是什么?

flash html5 canvas

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

组织班级......最佳实践?

说我有一个课程如下

    class FootballPlayer
    {
        public string Name { get; set; }
        public string TeamName { get; set; }

        public int CareerGoals { get; set; }
        public int CareerAssists { get; set; }
        public int CareerPasses { get; set; }

        public int SeasonGoals { get; set; }
        public int SeasonAssists { get; set; }
        public int SeasonPasses { get; set; }

        public int CurrentMatchGoals { get; set; }
        public int CurrentMatchAssists { get; set; }
        public int CurrentMatchPasses { get; set; …
Run Code Online (Sandbox Code Playgroud)

c# class

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

这个函数的正确签名是什么?

此代码无法编译并出现此错误

src/JsonParser.hs:33:37-62: error:
    * Couldn't match type `b1' with `b'
      `b1' is a rigid type variable bound by
        the type signature for:
          resultantRunParse :: forall b1. String -> Maybe (String, b1)
        at src/JsonParser.hs:29:5-52
      `b' is a rigid type variable bound by
        the type signature for:
          fmap :: forall a b. (a -> b) -> Parser a -> Parser b
        at src/JsonParser.hs:27:11-42
      Expected type: Maybe (String, b1)
        Actual type: Maybe (String, b)
Run Code Online (Sandbox Code Playgroud)

编码:

import Prelude

newtype Parser a = Parser
  { …
Run Code Online (Sandbox Code Playgroud)

haskell

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