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 MessageBoxespublic 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; }}
|