MBOM_GetMessageBoxes






















Name


MBOM_GetMessageBoxes


Location


BizTalkMgmtDb


Purpose


Enumerate available BizTalk Server message boxes


Columns


DBServerName DBName


Comments


You can use the results to create instances of Microsoft.BizTalk.Operations.MessageBoxDatabase. This will enable you to determine whether the message box is accepting activation messages or is the master message box. 


Example

// Need this as well as SQL stuff, etc.
using Microsoft.BizTalk.Operations;

// Collection Class
public sealed class MessageBoxDatabaseCollection : List<MessageBoxDatabase>
{
public MessageBoxDatabaseCollection()
: base()
{
}
}

// Accessor that gets a collection of MessageBoxes
public MessageBoxDatabaseCollection MessageBoxes
{
get
{
MessageBoxDatabaseCollection msgBoxes = new MessageBoxDatabaseCollection();

// Make sure you supply a connection string
using (SqlConnection con = new SqlConnection(connectionString))
{
con.Open();
using (SqlCommand cmd = con.CreateCommand())
{
cmd.CommandText = "MBOM_GetMessageBoxes";
cmd.CommandType = CommandType.StoredProcedure;
using (SqlDataReader rdr = cmd.ExecuteReader())
{
// Pull DBServerName, DBName
while (rdr.Read())
msgBoxes.Add(new MessageBoxDatabase(rdr.GetString(0), rdr.GetString(1)));
}
}
}

return msgBoxes;
}
}

Skip to main content