标题:求助,写的程序帮忙看下
取消只看楼主
mj77172469
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-11-22
结帖率:0
已结贴  问题点数:20 回复次数:2 
求助,写的程序帮忙看下
string sql4 = string.Empty;
                    sql4 = @"select device.id from device, event1 where device.IDENTIFY=event1.MC_HOST_ADDRESS and device.TYPE=event1.MC_ORIGIN_CLASS and device.OBJECT =event1.MC_OBJECT_OWNER  and device.TYPE='服务器'
                            union all
                            select device.id from device, event1 where device.IDENTIFY=event1.MC_HOST_ADDRESS and device.TYPE=event1.MC_ORIGIN_CLASS and device.OBJECT =event1.MC_OBJECT_OWNER and device.SUBOBJECT=event1.MC_OBJECT and device.TYPE='数据库'
                            union all
                            select device.id from device, event1 where device.IDENTIFY=event1.MC_HOST_ADDRESS and device.TYPE=event1.MC_ORIGIN_CLASS and device.OBJECT =event1.MC_OBJECT_OWNER and device.SUBOBJECT=event1.MC_OBJECT and device.TYPE='中间件' ";
                           
                        oc.ExecuteReader(sql4);
                   //     int "+id+" = oc.ExecuteReader(sql4);

                        if( "+id+" != null)


                        {   string sql5 = string.Empty;
                     sql5=@"insert into alert (alert.id,alert.eventid,alert.deviceid,alert.status,alert.parameter,alert.value,alert.severity,alert.msg,alert.ticketid,alert.ticketstatus,alert.timestamp,alert.createtime,alert.lastmodifiedtime) values ('9999',event1.mc_tool_sev,
 '+id+',event1.status,event1.MC_PARAMETER,event1.mc_parameter_value,'2',event1.msg,event1.mc_object_uri,event1.mc_service,event1.MC_INCIDENT_TIME,event1.MC_ARRIVAL_TIME,event1.DATE_RECEPTION)";
                     oc.ExecuteReader(sql5);
                        
                        }

                        
                        else;


                        {
                         return;
      
                        }
搜索更多相关主题的帖子: 服务器 where 
2012-11-22 13:30
mj77172469
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-11-22
得分:0 
我在sql里查出来的id  可以直接if( "+id+" != null) 使用吗
2012-11-22 13:30
mj77172469
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2012-11-22
得分:0 
回复 3楼 newdos
你帮我看下被 谢谢了
那我改成
  oc.ExecuteReader(sql4);
                    int id = oc.ExecuteReader(sql4);

                        if( id!= null)
{。。。

可以吗
2012-11-22 14:02



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-387930-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.823841 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved