小编Pio*_*ski的帖子

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid

I have a one entity framework object and when I add it to my project, the connectionstring is added to app.config in the connectionstring section, but when I want to create new entitycontext and use this connectionstring, this error appears

entity-framework entity-framework-4

168
推荐指数
5
解决办法
9万
查看次数

可空类型是引用类型吗?

当我宣布一个可以int为空的时候

int? i=null;
Run Code Online (Sandbox Code Playgroud)

i这里是否成为参考类型?

.net c# types nullable

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

SQL Server - 将存储过程从一个db复制到另一个db

我是SQL的新手,我需要做的是将2个.mdf数据库合二为一.我使用SQL Server 2008管理器 - 任务>导入/导出表执行了此操作.表和视图已成功复制,但新数据库中没有存储过程.有没有办法做到这一点?

sql copy procedures sql-server-2008

81
推荐指数
4
解决办法
14万
查看次数

在可选参数中设置DateTime的默认值

如何在可选参数中设置DateTime的默认值?

public SomeClassInit(Guid docId, DateTime addedOn = DateTime.Now???)
{
    //Init codes here
}
Run Code Online (Sandbox Code Playgroud)

c# datetime default optional-parameters

80
推荐指数
5
解决办法
7万
查看次数

备份单个表,其从数据库SQL Server 2008中的数据

我想从一个数据库在SQL Server中使用脚本来获取其数据的单个表的备份.

我怎样才能做到这一点?

sql sql-server sql-server-2008

78
推荐指数
6
解决办法
27万
查看次数

如何检查连接字符串是否有效?

我正在编写一个用户手动提供连接字符串的应用程序,我想知道是否有任何方法可以验证连接字符串 - 我的意思是检查它是否正确以及数据库是否存在.

c# connection-string

73
推荐指数
3
解决办法
8万
查看次数

Cassandra cqlsh - 连接被拒绝

我刚刚开始使用Cassandra(datastax),版本2.1.3和cqlsh版本5.0.1.

Cassandra启动良好,集群即时运行.

Cqlsh无法正常工作(在任何节点上)并发出以下错误:

连接错误:('无法连接到任何服务器',{'127.0.0.1':错误(111,"尝试连接到[('127.0.0.1',9042)].上次错误:连接被拒绝")})

我尝试用主机自己的ip,其他主机ip,不同的端口启动cqlsh但结果仍然相同 - 始终连接被拒绝.

cassandra cqlsh

51
推荐指数
5
解决办法
9万
查看次数

SSRS表达式将NULL替换为另一个字段值

我需要编写一个SSRS表达式来检查并将NULL字段值替换为另一个字段值.可以这样做吗?

reporting-services

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

为什么float.Epsilon而不是零?

在下面的代码中,为什么与float.Epsilon进行比较而不是0?

// Coroutine to move elements
protected IEnumerator SmoothMovement (Vector3 end)
{
    // Distance computation
    float sqrRemainingDistance = (transform.position - end).sqrMagnitude;

    while(sqrRemainingDistance > float.Epsilon)
    {
        Vector3 newPostion = Vector3.MoveTowards(
            rb2D.position, end, inverseMoveTime * Time.deltaTime
        );
        rb2D.MovePosition (newPostion);
        sqrRemainingDistance = (transform.position - end).sqrMagnitude;
        yield return null;
    }
}
Run Code Online (Sandbox Code Playgroud)

c# floating-accuracy unity-game-engine

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

使用Linq计数组

我有一个看起来像这样的对象:

Notice 
{
    string Name,
    string Address 
}
Run Code Online (Sandbox Code Playgroud)

List<Notice>我想要输出所有不同的名称和特定在集合中出现的次数.

例如:

Notice1.Name="Travel"
Notice2.Name="Travel"
Notice3.Name="PTO"
Notice4.Name="Direct"
Run Code Online (Sandbox Code Playgroud)

我想要输出

Travel - 2
PTO - 1
Direct -1
Run Code Online (Sandbox Code Playgroud)

我可以使用此代码获得不同的名称,但我似乎无法在1个linq语句中获得所有计数

  theNoticeNames= theData.Notices.Select(c => c.ApplicationName).Distinct().ToList();
Run Code Online (Sandbox Code Playgroud)

c# linq group-by count distinct

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