For those new to message boards please try to follow a few simple rules when posting your question.
Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
Keep the subject line brief, but descriptive. eg "File Serialization problem"
Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode "<" (and other HTML) characters when pasting" checkbox before pasting anything inside the PRE block, and make sure "Use HTML in this post" check box is checked.
Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
Please do not post links to your question into an unrelated forum such as the lounge. It will be deleted. Likewise, do not post the same question in more than one forum.
Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
No advertising or soliciting.
We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
Ok so I am hoping I can get some help here please?
My situation is that we have three environments 2 are using sql server and 1 is using sql server clustered.
We have a SSIS package that is used to create xml files which works perfectly in environment 1 and 2. However in environment 3 the using clustered sql the xml file generated is out of sequence. It's lists all odd numbered records first then all the even numbered ones.
Everything between the environment is like for like so I cannot see why this is happening.
Are there any steps or an approach I can use to see why this could be happening?
It's lists all odd numbered records first then all the even numbered ones.
Why is that a problem?
Member 13357915 wrote:
so I cannot see why this is happening.
Assuming ordering perhaps. If you are not explicitly ordering the records then you are assuming the ordering. There is no assurance of ordering. It might normally be ordering (default ordering) by the primary index and that might change with a cluster.
ID Device id TimeZone Effective Date
1123 CST 2017-01-07 00:00:00.0001123 PST 2017-06-24 00:00:00.0001123 MST 2017-08-02 00:00:00.0002345 CST 2017-07-01 00:00:00.0002345 PST 2017-08-01 00:00:00.0004678 CST 2017-08-02 00:00:00.000
The above table is Name Timetable .I looking for below result if i pass date parameter
as ‘2017-08-01 00:00:00.000’
ID Device id TimeZone Effective Date
1123 CST 2017-01-07 00:00:00.0002345 PST 2017-08-01 00:00:00.0004678 CST 2017-08-02 00:00:00.000
Thank you .it has solved partially but still have one problem
If we have rows which are less than or equal for the supplied parameter(Date) we are pulling highest date row here this is working correct .
if we don't have any rows which are less than or equal for the supplied parameter(Date) and if we have rows which are greater than supplied parameter we need to pull lowest date.can you help in this regard
Strange, Could of swore when I first wrote this, I was just getting 1 record.
Then I changed the return value to List from IEnumerable and starting getting 3 records back for each record.
But I doubt that had anything to do with it. I did raise the .Net level to 4.5.2.
Must be my And Statement.
I tried Distinct but It doesn't seen to be working, most likely because I have no clue how use it here.
I started writing in c# and MVC and don't write like this anymore.
Public Shared Function load_COH_ListBox_Info(
ByRef pResults As List(Of cohIndex)) As Integer
Dim pValue As Integer = 0
Dim context As New hx5Context()
From oh In context.Order_History
Where oh.OrderDate >= DbFunctions.AddDays(Today, -40) _
oh.OrderStatus = "COMPLETED" _
Or oh.OrderStatus = "ORDER_CANCELED" _
Or oh.OrderStatus = "ORDER_CANCELED_REFUND_COMPLETE"
Order By oh.OrderNumber Descending
Select New cohIndex With
.orderID = oh.CompletedOrderID,
.orderNumber = oh.OrderNumber,
.orderDate = oh.OrderDate,
.orderStatus = oh.OrderStatus,
.accountName = oh.LoginID,
.total_NetCharge = oh.GrandTotal
pValue = pResults.Count()
I am surprised as to why you didn't consider using GroupBy function? That would be useful in grouping the objects by a property, so that only distinct ones are returned, since they will be grouped by their property in a similar manner, to what you want to expect from Distinct function call here. Something like this,
// Since you said C#from oh in context.Order_History
where oh.OrderDate ...
orderby oh.OrderNumber desc
group oh by oh.RequiredProperty in ohGrouped // RequireProperty is the property you want to use
Something like this will be useful, as it will group the records by the properties which you specify. Please have a look here, [c# - Group by in LINQ - Stack Overflow](https://stackoverflow.com/questions/7325278/group-by-in-linq)
There is a library, which contains a lot of added features to LINQ, you should also look into it as it might also help you out with a lot of good function calls, such as this DistinctBy (DistinctBy takes the properties by which you want to select the records), get it here, GitHub - morelinq/MoreLINQ: Extensions to LINQ to Objects
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
Last Visit: 31-Dec-99 18:00 Last Update: 17-Aug-17 8:41