Tuesday, September 30, 2014

Read dynamic data from unmanaged memory

I have images comming back from an unmanaged DLL. The size of the image is dynamic = it can change from a call to the other


For this I have a structure reprenting the image + its size that looks like :



[StructLayout(LayoutKind.Sequential)]
private unsafe struct StructImage
{
public uint imageDate;
public uint imageSize;
public byte* imageData;
}

I get from the application a pointer to my structure. I read the info like this



IntPtr imagePtr = ...
StructImage imageInfo = (StructImage)Marshal.PtrToStructure(imagePtr, typeof(StructImage));

Now I would get the size of the image and I would like to read the data like this



byte[] buffer = new byte[imageInfo.imageSize];
IntPtr srcPtr = new IntPtr(imageInfo.imageData);
Marshal.Copy(srcPtr, buffer, 0, buffer.Length);

At this point I get an "AccessViolationException"


I understand that the Marshal.PtrToStructure declares that I will be reading unmanaged memory according to the size of my structure = when it comes to the imageData field only 4 bytes are declared "readable" for the byte*


I red hundreds of forums/blogs talking about marshalling between managed and unmanaged memory but I still cannot figure out how I can extend the "reserved" unmanaged memory to the length of my data


Can someone help me out ther ?


Thanks a lot


Christophe


Read dynamic data from unmanaged memory

Hi Christophe,


As far as I know, if you want to use Marshal.PtrToStructure to marshal unmanaged memory block to managed object, the unmanage memory block and the managed object must be type-compatible. For example, if you use Marshal.AllocHGlobal method to allocate unmanaged memory for the managed structure or class with StructLayout attribute, then you'll successfully use Marshal.PtrToStructure to convert the unmanaged memory back to the structure. Check the sample code in this MSDN document:


Marshal. PtrToStructure Method (IntPtr, Type)


But in your case, seems that you don't know the exact structure of the imange in the unmanaged dll, so I don't think you can convert the unmanaged image memory to your own custom structure.


If the images are icons, you can P/Invoke the ExtractIconEx function:



[DllImport("Shell32.dll", EntryPoint = "ExtractIconExW", CharSet = CharSet.Unicode, ExactSpelling = true, CallingConvention = CallingConvention.StdCall)]
private static extern int ExtractIconEx(string sFile, int iIndex, out IntPtr piLargeVersion, out IntPtr piSmallVersion, int amountIcons);



Also check this blog for how to extract images in an unmanaged dll from managed code:


How to load unmanaged (native) resources from managed C#




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


SQL Server 2014 Bug - with Clustered Index On Temp Table with Identity Column

Thanks Steve. I confirm the above behavior. Can you post a bug on Connect:


http://ift.tt/Pv3qK2








Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014









SQL Server 2014 Bug - with Clustered Index On Temp Table with Identity Column

Yes -- here it is:


http://ift.tt/1vvs2Cy



SQL Server 2014 Bug - with Clustered Index On Temp Table with Identity Column

What is Select @@version?



I am unable to repro it. My version is below


Microsoft SQL Server 2014 - 12.0.2370.0 (X64)


Jun 21 2014 15:21:00


Copyright (c) Microsoft Corporation


Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: ) (Hypervisor)


 




Balmukund Lakhani

Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker

--------------------------------------------------------------------------------

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------------------------------------------------------------------

My Blog | Team Blog | @Twitter | Facebook

Author: SQL Server 2012 AlwaysOn - Paperback, Kindle


Stored Proc with SSRS multi value parameter gives " Must Declare scalar Varaiable @StateID

Hi,


Could you check if all the query parameter values point to the right ones @dataset properties like so



Hope this helps


Thanks


Bhanu


Stored Proc with SSRS multi value parameter gives " Must Declare scalar Varaiable @StateID

Thanks for the quick reply. I verified, they are binded correctly.


Thanks


RH




sql


Select all objects available for a given date range, etc

But that Query doesn't give me the available houses from a given date range. It only shows the houses that are not in the Reservation table.


Let's say a user wants to rent any of the existing houses between the 10th of October and 20th of October. What should be returned is a list with available objects/houses for that date range.




Peter Centellini


What is max size of slicer values in Power View on SharePoint?



You cannot vote on your own postI have Power View on SharePoint 2013 and OLAP Cube on SQL Server 2014 solution.


I should have 1000 values in DimCity, but not all are available in slicer.


Why? What is max value?






Kenny_I


How to make slicer to remember selected values while moving from report to another

I have Power View on SharePoint 2013 and OLAP Cube on SQL Server 2014 solution.


1) I select slicer values and graphs are updated


2) I move to next page on same Power View file and use slicers.


3) I come back to original reports. My slicer valuers are empty.


Is it possible to make slicer to remember selected values while browsing from reports to another?


Ken




Kenny_I


Validating fields in WrkTaskIP page

Hi,


How about using the alert outside of the click function? Could you get the alert?


If that is the case, the issue may be caused that you have not get the button value correctly using the ID element.


You can use the input element and id to get the rejection button, such as “$(input[id=’Approval_btnReject ’])”, then check whether it works.


You can also use the class element to achieve it.


Thanks,


Jason


Forum Support


Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.




Jason Guo

TechNet Community Support



Validating fields in WrkTaskIP page

Hi,


I was able to get that working, but I believe it is not correct fully.


when the comments field is not added, and reject button is clicked, I am able to get alert "Please enter comments", but after entering comments and again clicking on Reject, is not processing it.


I have used the below code:



$(document).ready(function () {

var buttons = document.getElementsByTagName("input");

var buttonsCount = buttons.length;

for (var i = 0; i <= buttonsCount; i += 1) {

if (buttons[i].value == "Reject") {

buttons[i].onclick = function (e) {

var txtarea = document.getElementsByTagName("textarea");

var txtareaCount = txtarea.length;

for (var i = 0; i <= txtareaCount; i += 1) {

if (txtarea[i].title == "Type comments to include with your response.") {

if (txtarea[i].value == "") {

alert("Please enter Reason");

e.preventDefault();

return false;

}

else {

return true;

}

}

}

};

}

}

});

The reject button is having the control defined, when I see F12




<input style="width: 76px; height: 21px; text-align: center;"
id="ctl00_PlaceHolderMain_XmlFormControl_V1_I1_B7"
class="w_5jghZOsnCxGdM8MP_0 x_5jghZOsnCxGdM8MP_0 a6_5jghZOsnCxGdM8MP_0 aw_5jghZOsnCxGdM8MP_0"
onfocus="return (Button.OnFocus(this, event));"
title="Reject" onclick="return (Button.OnClick(this, event));"
value="Reject" type="button" OriginalId="V1_I1_B7"
FormId="ctl00_PlaceHolderMain_XmlFormControl" ViewDataNode="13"
direction="ltr" wrapped="true" ScriptClass="Button"
buttonid="Approval_btnReject">


Now my code is also adding a onclick event, so I believe it is not working in the "return true".


I am doing this in a copy of the "WrkTaskIP.aspx", which I have refered as the page in VS 2012 workflow.


How to fix this?


Thanks


Validating fields in WrkTaskIP page

Hi,


I have fixed this issue, by doing the below:


1) Create a copy of the existing OOB "WrkTaskIP.aspx". Create a new page with it, and then refer the newly created page.


2) In the newly created page, add the below:



$(document).ready(function ()
{$("input[value='Reject']").prop("disabled",
true);
$("textarea").keyup(function () {

if ($(this).val() != "") {

$("input[value='Reject']").prop("disabled",
false);
}
else {

$("input[value='Reject']").prop("disabled",
true);
}
});


$("input[value='Reject']").parent("span")
.prop("onmouseover",
null)
.prop("onmouseout", null);

});

The above code does the below:


In page load, disables the Reject button. when some item is entered in the textarea, the reject button is enabled. This way we can make the comments as a mandatory field to click the reject button.


Hope it helps.


Thanks


my string is not working properly when i serach last price for every product

Use ROW_NUMBER() function to get last sale per customer per product


For every expert, there is an equal and opposite expert. - Becker's Law





My blog




My TechNet articles


my string is not working properly when i serach last price for every product

hi Naomi


i try row number but still is showing same result hear is my string with ROW_NUMBER()


SELECT MAX(Row), CustId, OrderDesc, Price, OrderByDeptId FROM (SELECT

ROW_NUMBER() OVER(ORDER BY (DeliveryNoteDt) DESC) AS Row,

s2.DeliveryNoteDt,

s1.OrderDesc,

s1.CustId,

s1.Price,

s1.OrderByDeptId,

ISNULL(s1.ExpectedWeight,0) ExpectedWeight

FROM dbo.tblDeliveryNote AS s2

INNER JOIN dbo.tblJobCard_Mst AS s1

ON s2.JobcardId = s1.JobCardId WHERE (YEAR(s2.DeliveryNoteDt) = '2013')) A

GROUP BY CustId, OrderDesc, Price, OrderByDeptId

ORDER BY CustId, OrderDesc


Result
























































































ROWCUSTIDPRODIDRATEDEPTID
430CUST-00038PROD-013955505
3777CUST-00038PROD-014012505
3776CUST-00038PROD-014032505
1236CUST-00038PROD-02237110005
1237CUST-00038PROD-02238110005
1238CUST-00038PROD-037621605
596CUST-00040416112
3515CUST-0004072738.752
298 CUST-00040 971 41 2
2368 CUST-00040 971 41.35 2

Select all objects available for a given date range, etc

1)


SELECT

HousingFacility.HousingFacilityId

FROM

HousingFacility H LEFT OUTER JOIN

Reservation R ON H.HousingFacilityId=R.HousingFacilityId

WHERE

R.HousingFacilityId Is Null





Select all objects available for a given date range, etc

Yes, I have to date parameters coming from the applikation set by the user.


Thanks!! I will check it.




Peter Centellini


Select all objects available for a given date range, etc

But that Query doesn't give me the available houses from a given date range. It only shows the houses that are not in the Reservation table.


Let's say a user wants to rent any of the existing houses between the 10th of October and 20th of October. What should be returned is a list with available objects/houses for that date range.




Peter Centellini


Polygon.RenderTransform offscreen but in visual tree does not execute

Hi,


I'm afraid that it is not the correct forum about this issue, since this forum is to discuss WPF.


So I have moved this thread to Windows Store Apps forum for better response.


Thanks for your understanding.


Best regards,

Franklin




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


Report viewer shows blank page but the blank page is skipped when exported to pdf

Hi,


I'm unable to understand your requirement ,You need Blank pages or not during printing ?


Thanks




Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.


Report viewer shows blank page but the blank page is skipped when exported to pdf

wondering why does it skip the blank page when it exports... either the blank page should exist as it is in the pdf..

Report viewer shows blank page but the blank page is skipped when exported to pdf

Thanks Simon.. I will be patiently waiting... so far i tried hiding stuff but it still doesnt work as expected...

Cascading Parameters

Cascading parameters work like this


You pass first parameter as a parameter for the query which will populate the values for the second parameter. ie dataset for param 2 will have param 1 passed as an argument. The data types of param1 and param2 can be different. Only thing is the field to which param 1 is compared in param 2's dataset query should have a data type which is compatible with param 1




Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


move/copy between document libraries

hi;


I search a tool (free) or script to enables end-users to copy and move content stored in SharePoint document libraries and lists.


Same this tool :


http://ift.tt/1xwc4LM


Best Regards


move/copy between document libraries

You can use the following tool from CodePlex


http://ift.tt/1rz4Z8a




Cheers,


move/copy between document libraries

HI;


I have already used this tool but I have a problem with usage note :



  • The tool must be installed locally on the server which hosts the site


We cannot use this tool directly from user work station or from ot the SP site collection GUI.


Regards


move/copy between document libraries

So why you are not using the SharePoint's OOB feature to move the items/ library using Site Content and Structures?


http://ift.tt/1rz4YkP


http://ift.tt/1xwc4eG




Cheers,


move/copy between document libraries

Hi;


OK this is for a admin and for the users (lector, conceptor, member, ..) ?


Regards


move/copy between document libraries

Yes, User who got permission to the document libraries/list can complete this action.


Cheers,


how to hide the existing links in my webpart

I am new for sharepoint 2010 technology.


My Requirement is like.


I have 5 links exist for my webpart.I want to hide one link for particular user.


Please suggest me how to proceed the above task.




Rama


Code scanning for .NET Framework 4.5 platform

Dear Michael Taylor Thank you for your information. But I think you may have some misunderstanding for my quesion, or may be I am not presenting the question clearly. What the Code scanning I concern for .NET Framework 4.5 platform is about the program code quality. May be I quoted from the Visual Studio Diagnostic Tools webpage. Improving Quality with Visual Studio Diagnostic Tools --> http://ift.tt/LSZEIE ============================================================================== "What is code quality? Correctness, performance, maintainability, and even elegance are all involved in creating great code. However you define it, Visual Studio diagnostic tools can help you and your team to develop and sustain high standards of code excellence." ============================================================================== Other MS tool like FxCop can achieve the above purpose --> http://ift.tt/144K935 ============================================================================== After digest the above reference link. I think you will know what the 2 questions talking about. Grateful if you or any expert can help again. Thanks.

Getting error in sql query

Hi,


that is because id is an integer and you can compare it to a string. You have to concatenate


oleDbCmd.CommandText = "delete from contacts where id=" +a;


Mark it as answer if it helps you.



Getting error in sql query

Hello,


Always use parameters


http://ift.tt/1vqiUQI




Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.


getting the max number and show the row

this



SELECT id,Name,Num
FROM MyTbl m
WHERE NOT EXISTS (
SELECT 1
FROM MyTbl
WHERE id = m.id
AND Num > m.Num
)





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


getting the max number and show the row

Here is an AdventureWorks example to get the maximum list price products for each color:



WITH CTE AS
(SELECT RNK=DENSE_RANK() OVER (PARTITION BY Color ORDER BY ListPrice DESC),
Color, ListPrice, ProductName=Name
FROM Production.Product WHERE ProductSubcategoryID > 0 AND Color is not null)
SELECT Color, ListPrice, ProductName FROM CTE
WHERE RNK = 1 ORDER BY Color, ProductName;
/*
Black 3374.99 Mountain-100 Black, 38
Black 3374.99 Mountain-100 Black, 42
Black 3374.99 Mountain-100 Black, 44
Black 3374.99 Mountain-100 Black, 48
Blue 2384.07 Touring-1000 Blue, 46
Blue 2384.07 Touring-1000 Blue, 50
Blue 2384.07 Touring-1000 Blue, 54
Blue 2384.07 Touring-1000 Blue, 60
Grey 125.00 Touring-Panniers, Large
Multi 89.99 Men's Bib-Shorts, L
Multi 89.99 Men's Bib-Shorts, M
Multi 89.99 Men's Bib-Shorts, S
Red 3578.27 Road-150 Red, 44
Red 3578.27 Road-150 Red, 48
Red 3578.27 Road-150 Red, 52
Red 3578.27 Road-150 Red, 56
Red 3578.27 Road-150 Red, 62
Silver 3399.99 Mountain-100 Silver, 38
Silver 3399.99 Mountain-100 Silver, 42
Silver 3399.99 Mountain-100 Silver, 44
Silver 3399.99 Mountain-100 Silver, 48
Silver/Black 80.99 HL Mountain Pedal
Silver/Black 80.99 HL Road Pedal
Silver/Black 80.99 Touring Pedal
White 9.50 Mountain Bike Socks, L
White 9.50 Mountain Bike Socks, M
Yellow 2384.07 Touring-1000 Yellow, 46
Yellow 2384.07 Touring-1000 Yellow, 50
Yellow 2384.07 Touring-1000 Yellow, 54
Yellow 2384.07 Touring-1000 Yellow, 60
*/









Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014







Find number emails from table


WHERE PATINDEX('%[0-9]%',email ) > 0





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


How to configure Summarize Total in RDLC using grouping concept through RDLC

Hi ,


You can try this as below;


Right click on the grouping area --> Add group --> Parent Group --> Group by 'Product Name'



Thanks




Please Mark This As Answer or vote for Helpful Post if this helps you to solve your question/problem.


Monday, September 29, 2014

How to use XmlReader.Create

When you initialize fields inline you can only reference static fields. This can lead to unwanted results and you should avoid it. If you need to reference other data, you should do you initialization in the constructor.


As an example or unwanted effects, the code below will result in intField3 being 3 and not 6 as order does matter when using static fields with inline initialization:



public class Class
{
private static int intField2 = intField;
private static int intField = 3;
private int intField3;

public Class()
{
intField3 = intField2 + intField;
}
}


getting the max number and show the row

this



SELECT id,Name,Num
FROM MyTbl m
WHERE NOT EXISTS (
SELECT 1
FROM MyTbl
WHERE id = m.id
AND Num > m.Num
)





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


Sharepoint 2010 ribbon not clickable in Safari 7.1

Does anyone have problem using SharePoint ribbon in Safari 7.1?? After the upgrade, the ribbon's been all gray out. Also, under edit page mode, nothing is clickable.


I have tried this http://ift.tt/1uy4vTr but no luck...



Find number emails from table

Hi All,


I have a table.


Id,Cname,Email


1,a,abc@gmail.com


2,b,bcd@gmail.com


3,c,asd44@gmail.com


4,d,sdf567@gmail.com


o/p:


3,c,asd44@gmail.com


4,d,sdf567@gmail.com


i want to display email contain numbers.


this query is causing deadlocks in multi TB database


CREATE Procedure [dbo].My_StoredProcedure
@masterlbtint
AS


declare @tbl table(

LID int,
szDescription varchar(100),
szName varchar(50)

)

insert into @tbl (LID,Descript,szName)
select LT.lid as LID, LT.Descript as Descript ,isnull(LTC.szName,'') as szName from Map_MasterLabTestsToLabTests LoinMap
inner join LaboratoryTest LT on LT.lid =LoinMap.lbtesting and LoinMap.lbtesting=(select max(lid) from LaboratoryTest where Descript=lt.Descript)
INNER JOIN TechnicaltestcatLTCM ON LT.lID = LTCM.lLabTest
INNER JOIN testcategoryLTC ON LTCM.lCategory = LTC.lID
inner join LOINCDB myDB on myDB.lid=LoinMap.imastertestlb

where LoinMap.imastertestlb=@masterlbt



select LID,Descript,szName from @tbl order by Descript





k


How to change image color in windows store app ?

What exactlly are you trying to do? WriteableBitmap gives you direct read/write access to data of each pixel. Are you trying to e.g. give a red tint to a black/white image?

How to change image color in windows store app ?

I am try to change an image of a red color to any selected color .


19karabo91


How to change image color in windows store app ?

Well, theoretically you can loop through all pixels in the image using a WriteableBitmap, check if the pixel is red and replace it with the Color you want. The question is wether all pixels that are red have the same shade of red?


Are the remaining pixels black or white or some other color?


How to change image color in windows store app ?

remaining pixels are white



19karabo91


How to change image color in windows store app ?

There's a code snippet to walk through the pixels and change colors at http://ift.tt/1rAI11K


For your case I'd probability look at each 4-byte pixel as a unit(rather than each better)


convert it to hue and the pick a range of reds.


SharePoint 2010 List View Web Part not showing for read-only users?

Hi,


are you using any look up type column in the main List where user do not have read only access also.


Please check this could be a possible option.


Regards


Soni K


SharePoint 2010 List View Web Part not showing for read-only users?

Can you check for ULS log and Fiddler trace


GO to page.aspx?contents=1 do you know see the webpart details


DO we face same issue with all users


can that user access the list?


Is there any permission inheritance?


Hope access for application page is not broken on that site




If this helped you resolve your issue, please mark it Answered


Convert SPList Items to PDF using iTextSharp

Hi, how can i convert SPList Items to PDF using itextsharp?


Convert SPList Items to PDF using iTextSharp

control to output to screen the details of a task

Hi Ireland,


According to your description, I realize you want to know the work process working in the task in store app. We can use Dispatcher.RunAsync method. Code looks like the following.



private void Button_Click(object sender, RoutedEventArgs e)

{

Task task = new Task(new Action(WorkProcess));

task.Start();

}



private async void WorkProcess()

{

await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>

{

ShowStatus("work start");

});

await Task.Delay(2000);



await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>

{

ShowStatus("connect to database start");

});

await Task.Delay(2000);



await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>

{

ShowStatus("connect to database end");

});

await Task.Delay(2000);



await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>

{

ShowStatus("download start");

});

await Task.Delay(5000);



await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>

{

ShowStatus("download end");

});

await Task.Delay(2000);



await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>

{

ShowStatus("work end");

});

await Task.Delay(2000);

}



private void ShowStatus(string msg)

{

txtMSG.Text += DateTime.Now.ToString() + " " + msg + "\r\n";

}



You can get my test project from my OneDrive. http://1drv.ms/1xvQXt2 .


If I misunderstand you, please feel free to let me know.


Regards,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.



SQL Query in SQL 2012 Reporting whith russian letters in WHERE соndition

When i try to build a report in SQL 2012 Reporting it works fine^



Select distinct sys.Netbios_Name0,sys.User_Name0, sys.Operating_System_Name_and0, arp.DisplayName0
FROM v_R_System sys
JOIN v_Add_Remove_Programs arp ON sys.ResourceID = arp.ResourceID
JOIN v_FullCollectionMembership fcm on sys.ResourceID=fcm.ResourceID
WHERE DisplayName0 like '%Microsoft Office%'
and DisplayName0 NOT like '%Update%'
and DisplayName0 NOT like '%Service%'
and DisplayName0 NOT like '%Components%'
and DisplayName0 NOT like '%MUI%'
and DisplayName0 NOT like '%Proof%'
and DisplayName0 NOT like '%File Validation%'
and DisplayName0 NOT like '%korrekturhilfen%'
and DisplayName0 NOT like '%Language Pack%'
order by DisplayName0



But if I try to set a condition



and DisplayName0 NOT like '%ANY_RUSSIAN_TEXT%'

where ANY_RUSSIAN_TEXT is some letters in Russian language, then this filter does not work and shows results which contains ANY_RUSSIAN_TEXT in DisplayName0 field.


Question: How should i set the SQL condition or maybe some SQL Reporting settings to make this query working?






If answer is helpful, please mark as answer or hit the green arrow on the left.


SQL Query in SQL 2012 Reporting whith russian letters in WHERE соndition

I asked and i will answer)))



and DisplayName0 NOT like N'%ANY_RUSSIAN_TEXT%'

This works




If answer is helpful, please mark as answer or hit the green arrow on the left.


Unable to show all fields from a table\view within a SSRS Report Model for user selection

Hi NM,



Could you provide the demo report in order that we can reproduce the issue on our end? Sorry for the inconvenience. You can upload it to any public workspace on the web in order that we can download it.


Regards


SharePoint 2010 List View Web Part not showing for read-only users?

Hello all,


I have List View Webparts on my Blank Web Part page, and it's not showing for Read-Only users.


Is this intended by Microsoft or is it a bug?


Thank you!


SharePoint 2010 List View Web Part not showing for read-only users?

Just check the permission level.


Show Information from several SharePoint in a single Report

Hi,


thanks a lot, that is definitely a new point of view to query this entries.


I´ll evaluate this and give it a try :)


Best regards,


Kai


Show Information from several SharePoint in a single Report

You could create an intermediate table in SQL Server which sould allow more flexibility of querying. The main gotcha in this approach is that the intermediate table would need to load prior to the report running. For a scheduled report this can be managed easily, whereas an ADHOC report might have problems.

Page Break in Report after details not working

I have used Access since the 2003 version, upgraded to 2007, 2010, and now 2013. I have always been able to force a new page on a report after the detail summary of the records from several different categories. Now, however, in 2013, even though I have selected to Force Page Break. It doesn't work!!! The entire list of categories is shown on one page, with one page header. Please advise.

Page Break in Report after details not working

This question should be posted on an Access forum. SQL Server Reporting Services functions differently and the answer we would give would relate to that product, not Access.

Getting the output when running a Process

Hello z0802361,


"Once process starts, if try to redirect output and get the text it will hang"

How you did this in your code? You may need to read the MSDN article below to see how you can do this:


http://ift.tt/LyDsNX


"The redirected StandardOutput stream can be read synchronously or asynchronously. Methods such as Read , ReadLine , and ReadToEnd perform synchronous read operations on the output stream of the process. These synchronous read operations do not complete until the associated Process writes to its StandardOutput stream, or closes the stream.


In contrast, BeginOutputReadLine starts asynchronous read operations on the StandardOutput stream. This method enables a designated event handler for the stream output and immediately returns to the caller, which can perform other work while the stream output is directed to the event handler.


Synchronous read operations introduce a dependency between the caller reading from the StandardOutput stream and the child process writing to that stream. These dependencies can result in deadlock conditions. When the caller reads from the redirected stream of a child process, it is dependent on the child. The caller waits on the read operation until the child writes to the stream or closes the stream. When the child process writes enough data to fill its redirected stream, it is dependent on the parent. The child process waits on the next write operation until the parent reads from the full stream or closes the stream. The deadlock condition results when the caller and child process wait on each other to complete an operation, and neither can proceed. You can avoid deadlocks by evaluating dependencies between the caller and child process."


Possible fix: The code example avoids a deadlock condition by calling p.StandardOutput.ReadToEnd before p.WaitForExit


Best regards,







Barry

We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


Getting the output when running a Process

This is what I tried



Process p = new Process();
// Redirect the output stream of the child process.
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.FileName = "StartFTP.bat";
p.Start();
// Do not wait for the child process to exit before
// reading to the end of its redirected stream.
// p.WaitForExit();
// Read the output stream first and then wait.
string output = p.ReadLine(); //This line will tell me whether it runs successfully or encounter error while running

I can't use ReadToEnd, as the program is continuously listening(FTP Server) and it is not supposed to end


I just want to read the first line to check whether it encounter any error.( I am printing this output in the web interface when I click the button it will execute the above code)


nvarchar(max) truncated dyanmic sql

Why do you conclude that the result is truncated? What does datalength(@sql) return?


The output in SSMS may seem truncated, but that is a display issue. SSMS truncates PRINT output at 8000 characters or so. You can do


SELECT @sql FOR XML PATH('')


The display will be somewhat ugly, but the XML display in SSMS fits 1MB by default.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

nvarchar(max) truncated dyanmic sql

Erland you're right the query is not truncated the XML showed complete query


Thanks


nvarchar(max) truncated dyanmic sql


Erland you're right the query is not truncated the XML showed complete query


Thanks



The setting that controls how many characters are displayed in SSMS output is below





Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c


SQL Syntax Formatter

Hello,


Does anyone know if there's any application or anything that can tidy up my SQL syntax?


For example I have the following code


select column1, column2 from schema1.something


I'm expecting the tool to have an ability to tidy up the code to be as follows


SELECT


[column1],


[column2]


FROM [schema1].[something]


Thanks and have a good day.


SQL Syntax Formatter

Check this


http://ift.tt/1mYhPOQ


We use something called "SQL Pretty Printer for SSMS" which is an addin for SSMS. It does beautify SQL Code pretty nicely




Regards, Ashwin Menon My Blog - http:\\sqllearnings.com


SQL Syntax Formatter

You can use an online one:


http://ift.tt/SgGgDz


SQL Syntax Formatter

Thanks, it does do the job but the square bracket is not included.

SQL Syntax Formatter

I've tried the plugin, but still the square bracket is not included

SQL Syntax Formatter

Thanks, can it automatically add the square bracket? I checked in their website, all the samples are converted without the square bracket.

SQL Syntax Formatter


I'm expecting the tool to have an ability to tidy up the code to be as follows



SELECT



[column1],



[column2]



FROM [schema1].[something]



Thanks and have a good day.



I have not paid attention to this thread previously. But in my opinion, this is untidying the code. Square brackets should only be used when neded. (And preferrably, they should not be needed, but you should stick regular identifiers.) Square brackets everywhere only makes the code more difficult to read.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

SQL Syntax Formatter

Hello Erland, I'm not fully agree with you about square brackets. In my opinion, they are important to identify that the keyword is not part of SQL reserved keywords (e.g. default, datetime, etc). This brackets also to make sure that the syntax will have no problem with syntax compatibility of the newer SQL version, in case we decide to upgrade our SQL version.


Anyway, I'm putting this brackets as of our standard code. So now I'm looking for tool to automate this. If you know any tool that can do this, please let me know.


Thanks


SQL Syntax Formatter

This is great thread to use in CLASS and lectures :-)


I used to keep some of those type of threads in order to explain people why you should use a good naming format :-)

Personally I think this is your designer/architect fault and you pay now for the mistakes, I highly recommend to learn from this, and use this time of upgrade to make some changing, if you can spare the time.


regarding your question , you might get a fast solution just using C# small application and parsing the text yourself (maybe even using T-SQL but this will be slow). The idea is the prepare a list of tables (which you can get using simple query), and then replacing those names in the text to a name with brackets. In some cases, if the data is in restrict format, I found that Excel can be nice tool for this type of parsing (split the data in excel -> add the brackets -> combine the data).




[Personal Site] [Blog] [Facebook]signature


SQL Syntax Formatter


Other than that, my database has to be compatible to all kind of SQL version including Azure. So I have no choice to make this square brackets as my standard code.



Of course you have choices!


My choice is to keep the code readable and free from noise, and when a new version of SQL Server introduces a new reserved keyword that clashes with an identifier I have, I take the hit in this case. After all, as long as your code is all stored procedures with no or a limited amount of dynamic SQL, finding these issues is a matter of rebuilding the database and track the compilation errors.


Microsoft are very conservative with adding new reserved keywords, a little too conservative in my opinion. For instance, SQL 2012 introduced the THROW statement, but they did not make THROW a reserved keyword and this introduced some funky behaviour.


SQL 2005 introduced a number of new reserved keywords. But since SQL 2008 and on, the only new reserved keyword I can recall is MERGE, but I may have overlooked one or two.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

SQL Syntax Formatter


This is great thread to use in CLASS and lectures :-)


I used to keep some of those type of threads in order to explain people why you should use a good naming format :-)

Personally I think this is your designer/architect fault and you pay now for the mistakes, I highly recommend to learn from this, and use this time of upgrade to make some changing, if you can spare the time.



I don't think there is a problem with good naming format or to blame the DB architect because of syntax compatibility. They will never know that the keyword will be incompatible with newer version until it released. In this case, "EXTERNAL" keyword was okay in SQL 2000, but not okay with SQL 2005. They already did their job to make the column name readable and understandable.


I don't want to blame SQL 2005 (and later versions) as well for this case, and that's why we decided to use square brackets to avoid this kind of problem in the future.


Thanks for your suggestion to make small c# application, we will consider this option to tidy up the code.


SQL Syntax Formatter


Of course you have choices!


My choice is to keep the code readable and free from noise, and when a new version of SQL Server introduces a new reserved keyword that clashes with an identifier I have, I take the hit in this case. After all, as long as your code is all stored procedures with no or a limited amount of dynamic SQL, finding these issues is a matter of rebuilding the database and track the compilation errors.


Microsoft are very conservative with adding new reserved keywords, a little too conservative in my opinion. For instance, SQL 2012 introduced the THROW statement, but they did not make THROW a reserved keyword and this introduced some funky behaviour.


SQL 2005 introduced a number of new reserved keywords. But since SQL 2008 and on, the only new reserved keyword I can recall is MERGE, but I may have overlooked one or two.





Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Thanks, we still prefer the square brackets to avoid the compatibility issue in the future.


How to get all the return value of delegate.

If you want to get separated values from the delegate you need to check GetInvocationList, so the code may look like that:



foreach (var meth in MyDelegate.GetInvocationList())
{
bool b = await ((Func<Task<bool>>)meth)();
}



However i think that it looks nasty and i have never uses delegates with multiple methods with return value other than void. It is not advisable.


Help changing all PK and FK datatypes from uniqueidentifier to nvarchar(128)

Is there a simple script to iterate through all my tables and change my PK and FK datatypes to nvarchar(128)? I don't want to have to go through each table manually, remove relationships, and change each key one by one. Here is my db schema if it helps.







Help changing all PK and FK datatypes from uniqueidentifier to nvarchar(128)

Why do you want to do that?


David




David http://ift.tt/1c5QNcs


Help changing all PK and FK datatypes from uniqueidentifier to nvarchar(128)

To answer the constructive questions asked. I was wanting to change them so they could work with Identity Framework 2.0. It uses GUIDs in code and automatically saves them as nvarchar(128)s in the Identity tables. I was going to change all of the PKs and FKs just to be consistent with Identity FW but I might just drop the Identity table PKs and recreate them as nvarchar(128)s. I could also alter Identity to save as uniqueidentifiers but I do not have the time to do that at the moment. I'm under a strict deadline to launch an MVP version of a site and see if people bite. Right now the main objective is rapid development. Ahem Mr. Celko.

Help changing all PK and FK datatypes from uniqueidentifier to nvarchar(128)

nvarchar(128) is an extremely poor choice for PRIMARY KEY.


The reason, some software likes it like that, is doubtful.


I would not change it.








Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014







Help changing all PK and FK datatypes from uniqueidentifier to nvarchar(128)

Celko, I deleted your message! I do not have time at this moment, to edit it as usual and remove all the rudeness parts.


It was already marked as abusive, by other users




[Personal Site] [Blog] [Facebook]signature


SubQuery Condition within a query returning multiple rows

Query


As in the query, the area where I need to have that condition in that CASE block. I have not really done much with these sort of queries, will read through tonight, but any help will be highly appreciated.




Kind Regards, Anils



Cannot deploy Windows 8.1 appx package when other user has already installed it?

Hi,


There is no way to uninstall our Windows Store app that has been installed by a different user. I don't have the ability to log on as that user since it was a domain account that no longer exists.


Kindly help.


Regards


Ashok


ssas cube as data source

Hi Vivek,


According to your description, you created SQL Server Reporting Sergvices report, the issue you want to get the previous day's data, right?


In this case, you can create a parameter to get the previous day, and then use this parameter to filter the data on the MDX query.


Create Parameter PreviousDay.

DateType:Date/Time

Visibility:Hidden

Default Vlaue:=Format(DateAdd("d",-1,today()),"yyyyMMdd")


Use the parameter in the MDX query like below.



select
{[Measures].[Internet Sales Amount]
} on columns,
{[Date].[Date].members} on rows
from(
select
(
STRTOMEMBER("[Date].[Date].&["+@PreviousDay+"]")
) on columns
from [Adventure Works]
)

If you have any questions, please feel free to ask.


Regards,




Charlie Liao

TechNet Community Support



lookupset in ssrs

Hi


If It is group By then insert a row outside the group below . Then select specfic field( all the way down where you would like to see the total ) >>>tex box properties>> fx then put the below expression in the expression box.


=Sum(Fields!order_amount.Value)


Hope it will work


Thanks


DataGridView Join

You should be querying the datatable, not the dgv.



DataTable resultTbl = new DataTable();
resultTbl.Columns.Add("Item No", typeof(int));
resultTbl.Columns.Add("Qty", typeof(decimal));

object[] result = (from row in getgrnstable.AsEnumerable()
group row by new { rawitemno = row.Field<string>("rawitemno") } into grp
select new
{
rawitemno = grp.Key.rawitemno,
linkedqty = grp.Sum(p => p.Field<decimal>("linkedqty"))
}).ToArray();
foreach(object[] row in result)
{
resultTbl.Rows.Add(row);
}




INotifyCollectionChanged Error Message

Add the reference of WindowBase assembly in the project if your project is compiled against v4.5 framework. It works for me.

Seems to be a Bug!

Thank you, Erland Sommarskog

Seems to be a Bug!

It is not throwing an error while creating the SP, since only on execution it start parsing the inner text (query/SP/dynamic query...) and then it raise the error. The same happened on dynamic query for example. The reason it is "hidden" during the create SP statement, is that it use external resource which the server do not check on "create SP": "INSERT INTO #TMP (ID_2) EXEC dbo.Sample_Procedure_1"


This has nothing to do with using SP in SP (nested SP) and I can re-create the issue in one SP if you want to see :-)


* Please close the thread, this is the way the server behaves. If you have any idea of improving or changing the indesign behavior than you can open a CONNECT :-)




[Personal Site] [Blog] [Facebook]signature


Seems to be a Bug!

You need to create the temp table before the first EXEC.


Parent session temp tables are visible in child sessions.








Kalman Toth Database & OLAP Architect SQL Server 2014 Database Design

New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014







Cryptography for Windows Store

Is this Resolved ? can some one tell me what alternative was found for SHA1Managed for Windows Store app?

sideloaded app can not change language programmatically

Hi there,



for an Enterprise solution the Client demands switching languages in app. I provided two different Solutions, which both are working fine. However - if the app is sideloaded I can't Switch the languages anymore... the code is being executed without any exceptions thrown. The language remains the same.


Is there some Kind of restrictions when the app is sideloaded? Because if I remote deploy to those devices, the language Switch is fine. After switching I'm recreating the views of course.


Here's the code I'm using:



if (newLanguage == "en")
{
var culture = new CultureInfo("en-US");
ApplicationLanguages.PrimaryLanguageOverride = culture.Name;
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "en";
}
if (newLanguage == "fr")
{
var culture = new CultureInfo("fr-FR");
ApplicationLanguages.PrimaryLanguageOverride = culture.Name;
CultureInfo.DefaultThreadCurrentCulture = culture;
CultureInfo.DefaultThreadCurrentUICulture = culture;
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = "fr";
}



or second (also working) solution:



if (prevLanguage != newLanguage)
{
ResourceContext defaultContextForCurrentView = ResourceContext.GetForCurrentView();
Windows.Globalization.ApplicationLanguages.PrimaryLanguageOverride = newLanguage;
ApplicationData.Current.LocalSettings.Values["currentLanguage"] = newLanguage;
defaultContextForCurrentView.Reset();
prevLanguage = newLanguage;
}






Sunday, September 28, 2014

TimeGenerated returns wrong value '01/01/1970 00:00:00' when querying the security event log using C#

Hi Yoni.h,


I can't reproduce your problem, I subscribe the EntryWritten event in my sample application, but I get the correct TimeGenerated and TimeWritten everytime.


Maybe there's some unknow bug in the EventLog component in the .NET Framework, but I'm not sure. I recomment that you use another way to query the event log periodically with WMI. You could check the sample code here for how to query event log with the help of WMI:


[CCS LABS] WMI: Reading the Event Log




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


RPC and folder related exceptions

Hi Hong,


Since your issue was encountered occasionally and worked fine in other time, I would recommend you check the environment of machine. I found someone has encountered this kind of issue before and solved by reinstalling the USB drive. You can see more info from http://ift.tt/1qMVa2O .


If you still have problem of this issue, please try to find more information and post here.


Regards,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


Customize PickerFlyoutBase command bar

Is there any way to customize a flyout, PickerFlyoutBase, command bar? I know you can add or remove the confirmation buttons, but what if I want to have different buttons?, or what if I want to disable the "Accept" button?


Alvaro Rivoir


Customize PickerFlyoutBase command bar

Hi Alvaro,


I find PickerFlyoutBase class is supported in windows phone 8.1 runtime app only, so I assume you are asking windows phone 8.1 runtime app question.


Microsoft provides some implementations inherited on PickerFlyoutBase class, such as ListPickerFlyout , DatePickerLayout , TimePickerFlyout . There classes provides limited properties to modify the Flyout UI. You can build a new class to inherit the base class and create your own PickerFlyout object.


An easy way to custom PickerFlyout UI is to define a Flyout in Button, write your own flyout UI in it. Close the flyout UI after the choice. Code looks like the following.



<Grid>

<StackPanel>

<Button Content="hello">

<Button.Flyout>

<Flyout x:Name="flyout1">

<StackPanel>

<TextBlock Text="Make your choice?"></TextBlock>

<Button Content="Yes" Click="Button_Click"></Button>

<Button Content="No" Click="Button_Click_1"></Button>

<Button Content="I don't know" Click="Button_Click_2"></Button>

</StackPanel>

</Flyout>



</Button.Flyout>

</Button>

<TextBlock x:Name="msg"></TextBlock>

</StackPanel>

</Grid>







private void Button_Click(object sender, RoutedEventArgs e)

{

msg.Text = "you click the yes button";

flyout1.Hide();



}

If I misunderstand you, please feel free to let me know.


Regards,




We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.

Click HERE to participate the survey.


Sharepoint 2013 and SSAS how to send reports on date schedule after dw load completes

Hi Ken,


This question should be more related to the SSAS, I'm going to move it to there and you will get a better assitance there regarding this question.


Thanks




Daniel Yang

TechNet Community Support




Jquery color codes for a column in sharepoint 2010 list does not work with filters

Hi,


Per my knowledge, the code in the CEWP cannot be executed after clicking page next control or applying list column filter.


I recommend you to use the setInterval() method to call the function that in your code, and the setInterval() method will continue calling the function.


http://ift.tt/NmnnR3


We can also use SharePoint Designer to add the Conditional Formatting to the list column and set the condition criteria separately.


Here are some links about applying conditional formatting to the list view in SharePoint Designer for your references:



http://ift.tt/1qMV5fi


http://ift.tt/1vnGHAK


Best regards.


Thanks




Victoria Xia

TechNet Community Support



How to change the colors of the winforms treeview after SetWindowTheme has been applied

I have a windows forms treeview. The default plus minus icons of the treeview are not updated with the Windows 7 styles.

To achieve that I have used the SetWindowTheme from UXTheme.dll



SetWindowTheme(tvwRoot.Handle, "explorer", null);

After applying this, I am unable to change the selectednode color of the treeview. I tried the following,



private void tvwRoot_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{

if (tvwRoot.GetNodeAt(e.Location) != null)
{
tvwRoot.SelectedNode = tvwRoot.GetNodeAt(e.Location);

tvwRoot.SelectedNode.BackColor = System.Drawing.Color.FromArgb(51, 153, 255);
tvwRoot.SelectedNode.ForeColor = System.Drawing.Color.White;

if (e.Button == MouseButtons.Right)
{
nodRightClick = tvwRoot.SelectedNode;
blnRightClick = true;
pntLocation = e.Location;
}
}
else
{
tvwRoot.SelectedNode = null;
nodRightClick = null;
}

}

private void tvwRoot_MouseUp(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (tvwRoot.SelectedNode != null)
{
if (tnPreviousSelected != null && !tnPreviousSelected.FullPath.Equals(tvwRoot.SelectedNode.FullPath))
tnPreviousSelected = tvwRoot.SelectedNode;
else if (tnPreviousSelected == null)
tnPreviousSelected = tvwRoot.SelectedNode;


tvwRoot.SelectedNode.BackColor = System.Drawing.Color.FromArgb(51, 153, 255);
tvwRoot.SelectedNode.ForeColor = System.Drawing.Color.White;
}

}

private void tvwRoot_AfterSelect(object sender, TreeViewEventArgs e)
{
if (tnPreviousSelected != null && !tnPreviousSelected.FullPath.Equals(tvwRoot.SelectedNode.FullPath))
{
tnPreviousSelected.BackColor = tvwRoot.BackColor;
tnPreviousSelected.ForeColor = tvwRoot.ForeColor;
tnPreviousSelected = null;
}

if (tvwRoot.SelectedNode != null)
{
if (tnPreviousSelected != null && !tnPreviousSelected.FullPath.Equals(tvwRoot.SelectedNode.FullPath))
tnPreviousSelected = tvwRoot.SelectedNode;
else if (tnPreviousSelected == null)
tnPreviousSelected = tvwRoot.SelectedNode;

tvwRoot.SelectedNode.BackColor = System.Drawing.Color.FromArgb(51, 153, 255);
tvwRoot.SelectedNode.ForeColor = System.Drawing.Color.White;
}
}



But with this the color appears on the treeview after the focus is removed from the treeview. Is there any way to change the color after SetWindowTheme has been applied?



An error has occurred during report processing. (rsProcessingAborted). Query execution failed for dataset 'DimUserWorkCentre'. (rsErrorExecutingCommand). The Cube either does not exists or has not been processed

Hi,


I'm having issues with the report created using SSAS cube.



  • An error has occurred during report processing. (rsProcessingAborted)

    • Query execution failed for dataset 'DimUserWorkCentre'. (rsErrorExecutingCommand)

      • The Operator_Performance cube either does not exist or has not been processed.






I have searched through internet and tried all the solutions, but didn't worked for me.


SSRS services running as NETEWORK SERVICE user.


SSRS Execution running as a Different user, which is the login is used to logon ot that server. I have also verified this user has access to database. I'm using Shared DataSource(SSAS Source) for this report.


Can any one please help me.


Thank You,


Praveen.







Praveen



SSRS Using WHERE in a calculated field

Thanks Katherine.


It doesn't return #Error but it does return only 0 instead of the expected result).


SSRS Using WHERE in a calculated field

Hi LB79,


Please refer to the following expression:

=sum(iif(Fields!InOut.Value ="In", CDbl(Fields!ID20.Value),CDbl(0)))-sum(iif(Fields!InOut.Value ="Out", CDbl(Fields!ID20.Value),CDbl0)))


If there are any other questions, please feel free to ask.


Thanks,

Katherine Xiong




Katherine Xiong

TechNet Community Support



SSRS Using WHERE in a calculated field

Hi Katherine and thanks for the suggestion.


Ive tried

=sum(iif(Fields!InOut.Value ="In", CDbl(Fields!ID20.Value),CDbl(0)))-sum(iif(Fields!InOut.Value ="Out", CDbl(Fields!ID20.Value),CDbl(0)))

and variations but it just returns 0.


SSRS Using WHERE in a calculated field

Hi LB79,


I already notice that the values for ID20 field are "IN" and "OUT", not "In" and "Out". This should be the reason why the expression returns 0. So please refer to the following expression:

=sum(iif(Fields!InOut.Value ="IN", CDbl(Fields!ID20.Value),CDbl(0)))-sum(iif(Fields!InOut.Value ="OUT", CDbl(Fields!ID20.Value),CDbl0)))


If there are any other questions, please feel free to ask.


Thanks,

Katherine Xiong




Katherine Xiong

TechNet Community Support



forward Dependencies are Invalid

Hi Rajesh_KK1,


Based on my experience, the issue always be occurred when we create parameters in the report. For example, we have already create a parameter @A, then create a parameter @B that depends on the parameter @A, while the values of @A also related to @B. That's what "forward dependencies" means. In Reporting Services, it is not allowed for two parameters to depend on each other.


To void this issue, we must remove the forward dependencies relationship. If the issue is still existed, please tell us the detail information about the issue. For example, the detail steps and the report design surface.


Thanks,

Katherine Xiong




Katherine Xiong

TechNet Community Support



Creating a function to read line in C#

I have a text file as follows:



NPSER NASER NQSER
10 5 3
JPNM EPNS RNPS
12 10 11
ACBE MNEF QPNS
25 11 78


This is a simplified data from my long data. I want to automatically find the values of NPSER, NASER, NQSER and so forth.


So far my code is as follows:



using System;
using
System.Collections.Generic;
using
System.Linq;
using
System.Text;
using
System.IO;

namespace read_file
{
class Program
{
static void Main(string[] args)
{
TextReader namefile = new StreamReader(@"E:\Code in C Sharp\read-file\read-file\test.txt");
string line = namefile.ReadLine();
Console.WriteLine(line);
Console.ReadLine();

////Read second line
string line1 = namefile.ReadLine();
Console.WriteLine(line1);
Console.ReadLine();
}

static public string[] Returnval(string line)
{
var Returnval = line.Split('\t');
return Returnval;
}
}
}


I have created a function Returnval which splits the string which are tab separated. I want to modify this function which would automatically take new line as input and then I should be able to use the function like this:



Returnval(NPSER, NASER, NQSER)

I tried to add a new line to Returnval function which is as follows:



string line = namefile.Readline();

I got an error saying namefile is not in context.


Any suggestions are highly appreciated.




Regards, Jdbaba