niuniu 2015-04-23 15:08 采纳率: 100%
浏览 1770
已采纳

我在线程中用ef写sql数据库的exe文件放到服务器就失败呢?

我在线程中用ef写sql数据库的exe文件放到服务器就失败呢?
提示:未将对象引用设置到对象的实例
代码:
private bool SaveData(float[] dispVal, ClientDto client)
{
//保存, 判断通道,没有则添加
ExtHost h;
BLL.ExtHostBLL host = new ExtHostBLL();

        h = host.GetHostByHostcode(client.HostId);

        int channelIndex = 1;
        string channelId = "";
        foreach (decimal val in dispVal)
        {

            if (!host.ExistChannel("通道" + channelIndex, h.Id, out channelId))
            {
                channelId = Common.Result.GetNewId();
                host.AddChannel(channelId, "通道" + channelIndex, client.HostId);

            }
            host.AddChannelData(Common.Result.GetNewId(), channelId, val);
            channelIndex++;

        }
        return true;

    }
  • 写回答

2条回答 默认 最新

  • threenewbee 2015-04-23 15:28
    关注

    和服务器没有关系,你的代码有问题,具体要调试才知道
    天知道你的bll的代码怎么写的。

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?