Oxiegen 88 Basically an Occasional Poster Featured Poster

Wouldn't have been easier to use iTextSharp instead?
It's free and already have all the classes and methods for creating/manipulating PDF's and converting them to images.

Oxiegen 88 Basically an Occasional Poster Featured Poster

stultuske:

so your point is: if I write it, it'll never be updated ?
weird philosophy.

That's what you took away from it, that the code would never be updated?
It's your code, you can update it however much you like, or not.

But what does any of this back and forth have to do with where you put the starting curly brace?
And no matter where you put that one single little thing, coders that might view the code after you WILL understand what's going on. And no recoding has to be done, or cleaned up, just for that.
It doesn't matter if some dusty old directive dictates where the curly brace goes. It's readable and can be understood by anyone doing Java.

That was my point. EOF.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Like I said.
Don't jump down my throat just because I have an opinion as an answer to the OP.

stultuske:
Your point of view is based on someone who works as a coder at some company.
My point of view is not.

Oxiegen 88 Basically an Occasional Poster Featured Poster

There is no right or wrong way in how you place those brackets.
It's your code. You do it in whatever way feels best for you.
Other java developers who might read your code will understand it just fine.

Oxiegen 88 Basically an Occasional Poster Featured Poster

Correction.
If you want to know how many open forms you have:

Dim count As Integer = My.Application.OpenForms.Count

Every time you open a form, it will be added to the OpenForms collection.
And every time you close a form with the .Close() and/or .Dispose() methods, it will be removed from the OpenForms collection.
So, OpenForms will keep a running track of what forms are opened and how many.

GeekByChoiCe commented: i am sorry but he dont want the number of ALL open forms. he want the count of forms with a given name. +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

The image is most likely stored as a byte stream in the database.
You have to read the image from the database into a byte array.
From there, you can read the byte array into a memory stream, which in turn is used to call: Image.FromStream(.....)

nick.crane commented: If you check the code this is clearly not the case! +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

So it's actually a CSV file.
Try this:

private void PopulateDataGridView()
{
    string filePath = "<path to dat file>";
    System.IO.TextReader reader = new System.IO.StreamReader(filePath);
    bool colAdded = false;
    DataTable table = new DataTable("data");

    try
    {
        while (reader.Peek() != -1)
        {
            string[] tokens = System.Text.RegularExpressions.Regex.Split(reader.ReadLine(), ",");
            if (!colAdded)
            {
                foreach (string token in tokens)
                {
                    table.Columns.Add(token);
                }
                colAdded = true;
            }
            else
            {
                DataRow row = table.NewRow();
                for (int i = 0; i < table.Columns.Count; i++)
                {
                    row[i] = tokens[i];
                }
                table.Rows.Add(row);
            }
        }

        dataGridView1.DataMember = "data";
        dataGridView1.DataSource = table;
    }
    finally
    {
        if (reader != null)
            reader.Close();
    }
}
Ketsuekiame commented: Well fed +0
Oxiegen 88 Basically an Occasional Poster Featured Poster

<bump>

sknake commented: bump -1