I think the following will work. It is probably also appropriate to add the line breaks after each line of the log that is added to logMsg.
Good luck
Code:
private void logToolStripMenuItem_Click (object sender, EventArgs e)
{
// Declare variables
String transId = String.Empty; // Transaction Id that we want to show
String logMsg = String.Empty; // Message
datatable_log = new Bluetooth_Sender_v._1._4.data_blue.logDataTable ();
// Retrieve data
/*
* This assumes that 'dataadapter_log' is instansiert in class 'logToolStripMenuItem_Click'
* Are in, and that it has a valid connection string.
*/
datatable_log = dataadapter_log.GetDataBy (transId);
// Processes and view data
if (datatable_log.Count == 0)
{
logMsg = "The log is empty.";
}
else
{
foreach (DataRow row in datatable_log.Rows)
{
if (row ["log"]! = null)
logMsg += (String) row ["log"];
}
}
MessageBox.Show (logMsg);
}
Bookmarks