I tried, no dice. I finally solved the issue with a somewhat dirty hack...

See the code:

Public Function GetTableDuplicates(ByVal table As DataTable) As DataTable
            Dim doubles As New DataTable 'Result table 
            Dim aRow As DataRow

            doubles.Columns.Add(New DataColumn("Column4Name", GetType(String)))  
            doubles.Columns.Add(New DataColumn("Column5Name", GetType(String)))

            Dim duplicates = From rows In table.AsEnumerable() _
                            .GroupBy(Function(r) New With { _
                            Key .a = r(4), _
                            Key .b = r(5) _
                            }).Where(Function(gr) gr.Count() > 1).ToList()

            For Each item As Object In duplicates 'not so proverbial, dirty hack here. 
                For Each r As Object In item  
                    aRow = doubles.NewRow()
                    aRow(0) = r(4).ToString()
                    aRow(1) = r(5).ToString()
            Return doubles.DefaultView.ToTable(True, "Column4Name", "Column5Name")
        End Function

The thing is, this works. But coming from C#... I've no idea why it works and why I can't explicitly access the new Object's members the same way I do in C#.

Anyways, thanks for the suggestion. This is an in-memory table, the project I'm currently working in doesn't even have a database.

Thanks again.

Begginnerdev commented: Glad you found a work around! +8

Info here: http://msdn.microsoft.com/en-us/library/2yd9wwz4(v=vs.71).aspx

You define it "square" by giving it the same size on both sides when you declare your array.

I whipped this up real quick. There are probably better ways to do it.

int N = 3;
Random rnd = new Random();
double min = -100.0;
double max = 200.0;

double[,] array = new double[N,N]; /*a single ',' in the [] means 2 dimensions*/
for(int i = 0; i<N; i++)
    for(int j = 0; j<N; j++)
        array[i, j] = rnd.NextDouble() * (Math.Abs(max) + Math.Abs(min)) - Math.Abs(min); //this is done so there are negative values between your range

for (int i = 0; i < N; i++)
    for (int j = 0; j < N; j++)
        Console.WriteLine(array[i, j]);

I'm guessing you have to update it, I don't have much experience with DataGrid views, but have you tried the doing:

Or maybe:


I might be wrong, maybe someone with more experience can suggest something else.

Try doing something like this:
MemoryStream stream = new MemoryStream(pic.Data.Data); //create an in memory stream
Bitmap image = (Bitmap)Bitmap.FromStream(stream);
PictureBox1.Image = image; //then you have to display the image in a picture box....

Remember, you have to create PictureBox1 using the toolbox, (or declaring a new one by yourself using code)...

For info on PictureBox class read here:


you are setting the split symbol as ','. since you have no commas in your string, that's why it's not splitting anything.

you have to set the split symbol as a ' ', (space)

For the icon of the application, all you need is an ".ico" file.

Right click on your project, select "properties" and in the "Application" tab you can set an Icon file.

Then, before using your application in any other computer, you have to run a "RELEASE" not a "DEBUG".

It will build an EXE file with the resource (icon) inside it.

There are websites online, that will convert a PNG to ICO and you can use that.

Hope it helps

ddanbe commented: Good advice! +9

You could store them in an array, and use the "distinct()" method.

I'm not sure if there's a more direct way to do it. Perhaps someone else here might know.

AngelicOne commented: thanks for the idea +1

Why can't you build it yourself?

It's as simple as compiling and running a debug, the EXE file gets made automatically when you debug/release your project.