小编Add*_*dde的帖子

升级到Visual Studio 2015后,Strange Build错误想要复制pagefile.sys

在解决方案中构建MVC项目时出现此错误.在我的解决方案中根本不存在对这些文件的引用.

C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\bootmgr" because it was not found.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\BOOTNXT" because it was not found.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\pagefile.sys" because it was not found.
1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4105,5): error MSB3030: Could not copy the file "D:\swapfile.sys" because it was not found.
Run Code Online (Sandbox Code Playgroud)

我的同事可以毫无错误地建立.

msbuild visual-studio-2015

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

T-SQL两个使用不同的where子句计数

我想计算具有不同where子句的表的值,并想知道是否有更好的方法.

在这段代码中,我算一个值.

SELECT v.name, count(v.value) AS v1
FROM dbo.table as v
WHERE v.organisationID = 2
AND v.datecreated > '2018-01-01'
AND v.datecreated < '2018-05-01'
AND v.value = 1
GROUP BY v.name
Run Code Online (Sandbox Code Playgroud)

我还想计算所有值为value = 2的行,我的方式是这样的,使用子选择.

SELECT v.name, count(v.value) AS v1, (SELECT v2.name, count(v2.value)  
FROM dbo.table as v2
WHERE v2.organisationID = 2
AND v2.datecreated > '2018-01-01'
AND v2.datecreated < '2018-05-01'
AND v2.value = 2
GROUP BY v2.name) AS v2
FROM dbo.table as v
WHERE v.organisationID = 2
AND v.datecreated > '2018-01-01'
AND v.datecreated …
Run Code Online (Sandbox Code Playgroud)

t-sql sql-server-2014

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

SqlParameter值还是sqlValue?

我收到这样的错误消息:

SqlParameterCollection仅接受非null的SqlParameter类型对象,而不接受String对象

在此代码上:

.Parameters.Add(new SqlParameter("@username", SqlDbType.NVarChar,128).Value = username);
Run Code Online (Sandbox Code Playgroud)

如果我将其更改为:

.Parameters.Add(new SqlParameter("@username", SqlDbType.NVarChar,128).SqlValue = username);
Run Code Online (Sandbox Code Playgroud)

不应该只重视工作吗?

sqlValue不是数据库类型吗?

这是我使用的DAL:

public class DBAccess : IDisposable
{

    private IDbCommand cmd = new SqlCommand();
    private string strConnectionString = "";
    private bool handleErrors = false;
    private string strLastError = "";

    public DBAccess()
    {
        strConnectionString = ConfigurationManager.ConnectionStrings["DB"].ConnectionString;
        SqlConnection cnn = new SqlConnection();
        cnn.ConnectionString = strConnectionString;
        cmd.Connection = cnn;
        cmd.CommandType = CommandType.StoredProcedure;
    }


    public CommandType CommandType
    {
        get
        {
            return cmd.CommandType;
        }
        set
        {
            cmd.CommandType = value;
        } …
Run Code Online (Sandbox Code Playgroud)

c# sql-server asp.net

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