Click here to Skip to main content
15,906,624 members
Home / Discussions / C#
   

C#

 
AnswerRe: how can do bold some items of comboBox Pin
Christian Graus20-Sep-06 1:27
protectorChristian Graus20-Sep-06 1:27 
GeneralRe: how can do bold some items of comboBox Pin
sikandarhayat20-Sep-06 1:44
sikandarhayat20-Sep-06 1:44 
GeneralRe: how can do bold some items of comboBox Pin
J4amieC20-Sep-06 2:49
J4amieC20-Sep-06 2:49 
Questioncan windows service start when the windows start ? Pin
abdallahziad20-Sep-06 0:47
abdallahziad20-Sep-06 0:47 
AnswerRe: can windows service start when the windows start ? Pin
Marek Grzenkowicz20-Sep-06 0:57
Marek Grzenkowicz20-Sep-06 0:57 
Generalalso i am asking about xml ?? Pin
abdallahziad20-Sep-06 1:08
abdallahziad20-Sep-06 1:08 
GeneralRe: also i am asking about xml ?? Pin
Colin Angus Mackay20-Sep-06 2:34
Colin Angus Mackay20-Sep-06 2:34 
GeneralRe: also i am asking about xml ?? Pin
abdallahziad20-Sep-06 2:39
abdallahziad20-Sep-06 2:39 
GeneralRe: also i am asking about xml ?? Pin
Marek Grzenkowicz20-Sep-06 3:07
Marek Grzenkowicz20-Sep-06 3:07 
GeneralRe: also i am asking about xml ?? Pin
abdallahziad20-Sep-06 3:18
abdallahziad20-Sep-06 3:18 
QuestionHow to display numbers in different formats like exponential Pin
deepualuru20-Sep-06 0:33
deepualuru20-Sep-06 0:33 
AnswerRe: How to display numbers in different formats like exponential Pin
Christian Graus20-Sep-06 0:42
protectorChristian Graus20-Sep-06 0:42 
QuestionORCA Pin
MHASSANF20-Sep-06 0:23
MHASSANF20-Sep-06 0:23 
AnswerRe: ORCA Pin
Christian Graus20-Sep-06 0:26
protectorChristian Graus20-Sep-06 0:26 
QuestionUsing C#, how to compare table data from 2 different databases Pin
JPD20-Sep-06 0:08
JPD20-Sep-06 0:08 
AnswerRe: Using C#, how to compare table data from 2 different databases Pin
Christian Graus20-Sep-06 0:29
protectorChristian Graus20-Sep-06 0:29 
QuestionC# and IBM WebSphere MQ message borwsing Pin
How Gee19-Sep-06 23:51
How Gee19-Sep-06 23:51 
AnswerRe: C# and IBM WebSphere MQ message borwsing Pin
Gavin Jerman20-Sep-06 1:39
Gavin Jerman20-Sep-06 1:39 
Replace MQC.MQGMO_BROWSE_FIRST with MQC.MQGMO_BROWSE_NEXT and call Get in a loop until it fails - it will throw a harmless exception with a reason code of MQRC_NO_MSG_AVAILABLE when there are no more messages to browse.

I would also suggest that you use MQGMO_NO_WAIT rather than MQGMO_WAIT so that you don't have to wait until a message appears on the queue when you browse an empty queue.

Example code using home-brewed helper methods:

public bool browseMessages(out ArrayList messages, string queue)
    {
      // browse (i.e. get without removing) a message on the message queue
      messages = new ArrayList();
      MQQueueManager mqQM = null;
      MQQueue mqQ = null;

      try
      {
        if (queue == null || queue.Length == 0)
          throw new Exception("Queue name required");

        // connect to queue manager
        connectManager(out mqQM);

        // open queue with required access
        connectQueue(mqQM, queue, MQC.MQOO_FAIL_IF_QUIESCING + MQC.MQOO_BROWSE, out mqQ);

        // get message options
        MQGetMessageOptions mqGMO = new MQGetMessageOptions();
        mqGMO.Options = MQC.MQGMO_FAIL_IF_QUIESCING + MQC.MQGMO_NO_WAIT + MQC.MQGMO_BROWSE_NEXT; // browse with no wait
        mqGMO.MatchOptions = MQC.MQMO_NONE; // no matching required

        MQMessage mqMsg = new MQMessage(); // object to receive the message

        // browse all messages on the queue
        while (true)
        {
          // browse message - exception will be thrown when no more messages
          mqQ.Get(mqMsg, mqGMO);

          // get message text from the message object
          messages.Add(mqMsg.ReadString(mqMsg.MessageLength));
        }
      }
      catch (MQException mqex)
      {
        if (mqex.ReasonCode == MQC.MQRC_NO_MSG_AVAILABLE)
        {
          // harmless exception MQ throws to indicate that there are no messages on the queue
          return true;
        }
        else
          throwMQException(mqex);
      }
      finally
      {
        if (mqQ != null)
          mqQ.Close();

        if (mqQM != null)
          mqQM.Disconnect();
      }

      return false;
    }

Gavin
QuestionHow to add a seperator in windows context menu ? Pin
Waqas Nasir19-Sep-06 23:47
Waqas Nasir19-Sep-06 23:47 
Questiondoubt about onlayout Pin
kalaveer19-Sep-06 23:22
kalaveer19-Sep-06 23:22 
QuestionHow to get the last command line argument or argument without the delimiter Pin
zxc8919-Sep-06 23:16
zxc8919-Sep-06 23:16 
AnswerRe: How to get the last command line argument or argument without the delimiter Pin
Christian Graus19-Sep-06 23:27
protectorChristian Graus19-Sep-06 23:27 
GeneralRe: How to get the last command line argument or argument without the delimiter Pin
zxc8919-Sep-06 23:47
zxc8919-Sep-06 23:47 
GeneralRe: How to get the last command line argument or argument without the delimiter Pin
Christian Graus19-Sep-06 23:49
protectorChristian Graus19-Sep-06 23:49 
GeneralRe: How to get the last command line argument or argument without the delimiter Pin
zxc8919-Sep-06 23:58
zxc8919-Sep-06 23:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.