| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 322 人关注过本帖
标题:求助,写的程序帮忙看下
取消只看楼主 加入收藏
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
快速回复:求助,写的程序帮忙看下
数据加载中...
 
   



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

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