I am new at this so be easy.
I have a messagebox.show that I want to display the result of a SQL select statement in. How do I do this please. I am using C# 2005.
I am new at this so be easy.
I have a messagebox.show that I want to display the result of a SQL select statement in. How do I do this please. I am using C# 2005.
Messagebox.show
Johan Petersson
Hi,
do you have an example in VB. I can't see to get this to work. Here is the code I am using. When invoked the page just sits there churning and eventualy comes back with page not found. Any idea what I'm missing
Sub
deleteComment(ByVal sender As Object, ByVal e As GridViewDeleteEventArgs) Dim Message As String = "This is a test" Dim Caption As String = "Delete Comment" Dim Buttons As MessageBoxButtons = MessageBoxButtons.YesNo Dim Result As DialogResultResult = MessageBox.Show(Message, Caption, Buttons, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
End SubTerryG
When you need it for debuggin, you can better flush it to you debug output window or something.
Sridhar Madhugiri
After reading your post to my question it did make me think about what I was trying to do. So, I decided that rather than do a MessageBox I would do it in a form. That worked out perfect. Thanks for at least making thin outside the box. It was a real learning experience.
One excited newbie,
Harry
Norman
Here is a little dirty piece of code, you must use a StringBuilder, finetune the code and format the message. But it is a example:
DataSet result = ...;
string message = string.Empty;
foreach(DataTable table in result.Tables)
{
message += String.Format( "--- Table: {0} ---\r\n", table.TableName );
foreach(DataRow row in table.Rows)
{
for(int i = 0; i < row.ItemArray.Length; i++)
{
message += String.Format("'{0}', ", row[ i ]);
}
message += Environment.NewLine;
}
message += Environment.NewLine;
message += Environment.NewLine;
}
MessageBox.Show( message );
randy_w_s
Greg Mandel
DataSet result = ...;
.Show(result.GetXml());MessageBox