Click here to Skip to main content
15,073,499 members

Comments by Staffan Bruun (Top 13 by date)

Staffan Bruun 20-May-16 6:27am View
The problem is not in the program itself, it's the server that won't let you access the page. Maybe you need to log on first, or provide credentials in your request?
Staffan Bruun 16-May-16 6:05am View
Oh, my bad. That '&' is supposed to be '%', for modulo operator. Now it just does binary AND, causing the problem.
Staffan Bruun 16-May-16 2:36am View
I added a way to calculate the column count to arrange the entities in a rectangle, see the updated solution.
Staffan Bruun 8-Jun-15 7:35am View
What is the name of the config file after it has been installed on the target computer? It should be the same as the executable except that it ends with config not exe.
Staffan Bruun 8-Jun-15 3:29am View
What software did you use to create the setup package?

Did you remember to include the .config file that was generated in the app output folder to the setup package?
Staffan Bruun 8-Jun-15 2:23am View
The following line in your original code, because of the 'where' clause, already selects only those lines with a matching customer code:

var chk = from c in AddDb.CustomerMasts where c.CustomerCode ==
txtCustCde.Text select c;

If there is no matching customer code, 'chk' will not contain any rows. In this case, the 'foreach' block is not executed. Remember that the code inside 'foreach' is run once for every row in the collection you specify; if there are no rows, it is not run at all.

Because the 'else' block of the 'if' statement is inside the 'foreach' block, it is also never executed.
Staffan Bruun 4-Mar-15 9:40am View
Depends. If you just want one table ordered so that all rows with the same EmpCata are together, you can use OrderBy(r=>r.EmpCata) after all the other stuff.

If you want separate tables for each EmpCata group, you need to use GroupBy(r=>r.EmpCata) at the end, then you need to iterate over each group to get the rows:

<pre lang="C#">
// processedData is assumed to be the data as processed previously
var groups = processedData.GroupBy(r=>r.EmpCata) // group data by EmpCata

foreach(var g in groups)
Console.Out.WriteLine("EmpCata: {0}", g.Key); // Key is whatever you put inside GroupBy()
Console.Out.WriteLine("EmpName\tFineAmt\tPaidAmt"); // optional, prints table headers
foreach(var row in g) // g itself is iterable and contains all rows in the group
Console.Out.WriteLine("{0}\t{1}\t{2}", row.EmpName, row.FineAmt, row.PaidAmt);
Staffan Bruun 21-Jan-15 9:42am View
The problem with that approach is that it will allow one row with the same FineAmt to cancel out several rows with the same PaidAmt, and vice versa.

I understood that the idea was to make sure that each FineAmt row only cancels out one PaidAmt row, which is why my initial solution focuses on counting the number of identical rows of each type.
Staffan Bruun 21-Jan-15 7:37am View
It is not that anything in your project would need 3.5, as such.

The problem, as I can tell from the web page, is that in order to add 2.0 support to Windows 8, you have to install .NET 3.5, because there is no separate .NET 2.0 installer for Windows 8.

This is why Windows 8 tells you it needs .NET 3.5 when it is trying to load your executable.

It seems strange that this error message only happens when you run the software after installing. Are there any warnings or errors during the installation process? (Try installing from the command line using msiexec with the /log <logfile> option.)
Staffan Bruun 21-Jan-15 7:25am View
Not when it is part of a character class.
Staffan Bruun 21-Jan-15 7:11am View
See updated solution.
Staffan Bruun 21-Jan-15 4:59am View
According to this Microsoft web page, Windows 8 has .NET 4.5 pre-installed, whereas .NET 3.5 can be installed on demand. This also includes support for .NET 2.0 and .NET 3.0.

You may have to change the installer to install the 3.5 framework in order to make it compatible with Windows 8.
Staffan Bruun 21-Jan-15 4:47am View
Do you only need to list those entries where the EmpName occurs exactly once in the set, or is the output based on some arithmetic calculation?