IIf function doesn't work (Visual Studio 2013 BI Tools) - visual-studio-2013

I'm using Visual Studio 2013 (with SQL-Server 2014, Reporting Services and BI Tools) and I try to add an simple "iif" expression but the compiler returns an Error (value = -1073741511)
I tried:
= IIf ( 3000 > 1000, "True", "False" )
Is it possible that the compiler doesn't support these kind of expression or are there similar ones?
What I need is an expression to get a value from my db where the id = x
= IIf ( Fields!ID.Value = 1 , Fields!Value.Value, 0 )

It was a problem with the compiler itself
See this post for more infos: Visual Basic Command Line Compiler has stopped working
anyway thanks!

Related

Assignment of arrays in Intel Fortran

I had an old Fortran 90 code with the following command:
data1(1:100) = data_all(:)
where data_all is a bigger array then data1.
Since I know that this is not a robust syntax, it worked good when using Visual Studio 2008.
I recently switched to Visual Studio 2013, and I am not able to use this code anymore, since it tries to fill the 101th position of data1.
What are the correct Compiler options to accept that?
Probably something like this:
data1(1:100) = data_all(1:100)
If data1 is 100 elements then
data1 = data_all(1:100)
If you want others then:
data1 = data_all(istart:(istart + (SIZE(data1) - 1))

Sequence contains no elements when using count on LINQ Query

IEnumerable<EntityReference> children = (
from c in OrgContext.CreateQuery<Account>()
where
c.ParentAccountId != null && c.ParentAccountId.Id.Equals(parentGuid)
select
c.ToEntityReference()).ToList();
return children.Count() > 0 ? null : new List<EntityReference>();
Throws a "Sequence contains no elements" error. How can I reliably check if the sequence is empty before trying to count the elements? (I'd expect Count to simply return 0)
This error for me was caused by visual studio using an old build instead of my current build. I don't know why it does this, but I've had it happen in visual studio 2012 and 2013. Just deleting the bin folder fixed it.
In your case, I think the problem is that you're using the Count() method instead of the Count property.

cmd.ExecuteNonQuery() return no integer

In my visual studio 2010, vb.net
Dim rowsAffect As Integer
sql = "Update temptable Set Exp_Amt=0 Where Exp_Amt is Null"
cmd.CommandText = sql
rowsAffect = cmd.ExecuteNonQuery()
When I debug this by use F10 key , rowsAffect = &HD .
Actually , rowsAffect value should be number 1 or 2 or something like that.
Is it need to change setting in VS 2010 IDE ?
To change how numbers are shown in the Watch, Locals, or Autos Window1, whilst debugging, you should right-click within the grid and tick (for hex) or untick (for decimal) the Hexadecimal Display option.
1Possibly others also, you haven't said where you're seeing this value, but those are the most obvious ones.

Parameters for Jump to Report in VS 2010

I have a report in Visual Studio 2010 with two fields that have jump to's. Both jump to the same report. However, one of them only requires 3 parameters to be passed whereas the other field requires 4. How can I keep the same report that is being jumped to for both fields? I can't figure out a way to not have to pass the Date parameter. I know I can create a separate dataset and a separate report, but I'd like to avoid that if possible.
SELECT SalesData.SBLOC, SalesData.SBCUST, SalesData.RMNAME, SalesData.SBITEM, SalesData.IFPRVN, SalesData.SBITD1, SalesData.SBDIV, SalesData.SBCLS,
SalesData.SBQSHP, SalesData.AVC, SalesData.SBEPRC, SalesData.SBINV, SalesData.SBORD, SalesData.SBTYPE, SalesData.SBINDT, SalesData.RMSTAT
FROM SalesData INNER JOIN
FiscalCalendar ON SalesData.SBINDT = FiscalCalendar.FiscalDate
WHERE (FiscalCalendar.FiscalYear = '2013') AND (SalesData.SBLOC IN (#Location)) AND (SalesData.SBTYPE = 'O') AND (FiscalCalendar.FiscalMonthName IN (#FiscalMonthName)) AND (FiscalCalendar.FiscalWeekNum IN (#FiscalWeekNum)) AND (FiscalCalendar.FiscalDate IN (#FiscalDate))

Can Visual Studio 2010 do conditional breakpoints on a type

I would like to set a conditional breakpoint in Visual Studio based on what a type is assigned as.
var resident = user.Resident ? new ResidentUser() : new NonResidentUser();
I would like my breakpoint to hit when resident is of type NonResidentUser.
Simple, in this case you can do condition = user.Residen == false, but in other cases you could do residen.GetType() == typeof(NonResidentUser).
You should be able to do that - set the condition to be resident.GetType() == typeof(NoneResidentUser).
OK, it seems that putting !user.Resident in the conditional window will fire when I want and therefore the type will be of NonResidentUser.

Resources