Friday, January 31, 2014
i want to know how MediaElement TransportControls working
i want to know how MediaElement TransportControls working
Can you please clarify your question? What exactly about the media transport controls do you need help with?
--Rob
i want to know how MediaElement TransportControls working
It's not quite clear to me what you are asking for here, so you may need to explain in more detail.
To fade the custom transport controls explained in the documentation you link I would create VisualStates for the hidden and visible states and switch between them. See Storyboarded animations for visual states .
--Rob
Calculated Field formula not appearing in Power View Field List panel
Hi,
On Power View1 sheet of this workbook, the two PowerPivot calculated Field formulas (First Visit and First date of FY) are not appearing in the Power View Fields panel on the right hand side.
I want to drag client and First Visit (calculated Field) to the Power View.
Why is this happening?
Regards, Ashish Mathur Microsoft Excel MVP www.ashishmathur.com
Why Webbrowser control does not release memory?
ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report
Free Tech Books Search
Why Webbrowser control does not release memory?
OK, I will try as you suggest. If any thing, then i will contact you.
Thanks for help.
How can I put checkboxes into an array and use FOR LOOP to add value to a total when a user check the box
If you are using Windows Forms and all of the checkboxes are on a single form, you can loop over the form's controls collection and when you come across a checkbox, do something (i.e. add a price to the total).
foreach (Control c in this.Controls)
{
if (c.GetType() == typeof(CheckBox))
{
//do something here
}
}
Once identified as a checkbox, a switch statement could be used to determine which checkbox and add an associated price.
- Brady My posts are kept as simple as possible for easier understanding. In many cases you can probably optimize or spruce up what I present. Have fun coding!
1 finger to draw, 2 fingers to pan, zoom, and drag?
1 finger to draw, 2 fingers to pan, zoom, and drag?
You get to write the code for that.
See the Quickstart links I provided earlier in the thread.
--Rob
1 finger to draw, 2 fingers to pan, zoom, and drag?
1 finger to draw, 2 fingers to pan, zoom, and drag?
What is the syntax for drawing a path? suppose I want to draw a semicircle, the xaml is this.
<Path Stroke="Black" StrokeThickness="1"
Data="M 1,0
A 1,1 0 0 0 1,9
C 1,10 1,0 1,0" Stretch="Fill" UseLayoutRounding="False" Width="26" />
What would be the c# code for this?
1 finger to draw, 2 fingers to pan, zoom, and drag?
See Move and draw commands syntax to understand what the Data path means. That document explains how each command (e.g. "M", "A", "C") maps to a specific class. For example, "A" is an arc and can be represented with an ArcSegment in your PathGeometry. "C" is a cubic Bezier and can be represented with a BezierSegment, etc.
Based on this you can unwind the Data string something like (untested):
// A Size RotationAngle isLargeArc SweepDirection EndPoint
var arc = new ArcSegment();
arc.Size = new Size(1,1);
arc.RotationAngle = 0;
arc.IsLargeArc = false;
arc.SweepDirection = SweepDirection.Counterclockwise;
arc.Point = new Point(1,9);
// C controlPoint1 controlPoint2 endPoint
var cubicBezier = new BezierSegment();
cubicBezier.Point1 = new Point(1, 10);
cubicBezier.Point2 = new Point(1, 0);
cubicBezier.Point3 = new Point(1, 0);
var figure = new PathFigure();
figure.StartPoint = new Point(1, 0); // M 1,0
figure.Segments.Add(arc); // A 1,1 0 0 0 1,9
figure.Segments.Add(cubicBezier); // C 1,10 1,0 1,0
var pathGeometry = new PathGeometry();
pathGeometry.Figures.Add(figure);
Windows.UI.Xaml.Shapes.Path p = new Windows.UI.Xaml.Shapes.Path();
p.Data = pathGeometry;
p.Stretch = Stretch.Fill;
p.Stroke = Resources["PathBrush"] as Brush;
p.StrokeThickness = 1;
p.UseLayoutRounding = false;
p.Width = 26;
--Rob
Why Webbrowser control does not release memory?
ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report
Free Tech Books Search
Problem with getting the Unique ID of a Windows 8 device
Microsoft may consider adding BIOS serial number to somewhere like EasClientDeviceInformation. It's essential for some operations. Many companies have their enterprise tied to those serial numbers and it's very crucial to have a way to obtain it. Just ask around from the companies whose machines are DELL or HP or etc. The way IT tracks the machines is usually based on that serial number. I can see scenarios that an application wants to verify the machine it is running on. 'SystemManufacturer' property is there which is better than nothing but having another property like 'SystemManufacturerSerialNumber' or similar is going to be very useful or businesses are forced to build their apps in traditional way if they need that feature.
Simple example of Timed background task for Store app?
You've already found the sample code for this, and it demonstrates everything you mention (except the every-minute debug mode, which doesn't exist). If you are having problems with your specific code please post a minimal repro to your SkyDrive which demonstrates what you are doing and where you have issues.
Syntax for Registering is in the Register the background task to run section of the Quickstart, as is syntax to check if the background task is already running. You would call these together as you want to check if the task is already running so that you don't restart it again if so.
--Rob
How to use an indicator on SSRS 2008?
Please set below expression in Indicator's color property
=IIF(Fields!Percentcol.Value >= 90, "Green", "Red")
where percentcol is the %tage column in your dataset .
Gaur
Why Webbrowser control does not release memory?
Drop a webbrowser control in window form then loading web page, we did some operation with form like autofill.
then load second page do some operation with that. ...so on.
when loop finished then at then end dispose the object and call the GC collect.
Now again loop through with another pages then try to do same operation as described above now
this time page not loaded and and when access the document property then it give null.
Any way to resolve the issue?
Why Webbrowser control does not release memory?
Hi All
I am using Webbrowser control in my c# windows application. I am trying to load different web pages.
But after some time page does not load and give Object reference error, I have found that it does not release memory
after whole process end, I am calling garbageCollertor but not a solution. I have that there is another WebKitBrowser
available, that does it.
How can i release memory after a process complete, Please give me answer soon?
Thanks.
Why Webbrowser control does not release memory?
Hello Amit m:
You can try to Dispose() method.
ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report
Free Tech Books Search
How could I implement a loop to add values of my array; rather than add them manually? (Cant think outside the box)
Basically I will have more methods that will all use "num2" thats why I used the HoldArray to clean up the Main Method...
So basically in the Max method I want to use some kind of loop to add all of the "storeMax" indexes to gather rather than do it all manually, but I dont know how that possible? Please help me free my brain from thinking "inside the box" Here is the code:
public static void HoldArray(double[,] Data)
{
Max(Data);
}
static void Main(string[] args)
{
double[,] num2 = new double[7, 2] { { 61.1, 81.1 }, { 62.2, 82.2 }, { 63.3, 83.3 }, { 64.4, 84.4 }, { 65.5, 85.5 }, { 66.6, 86.6 }, { 67.7, 87.7 } };
HoldArray(num2);
Console.ReadLine();
}
public static void Max(double[,] Data)
{
double[] storeMax = new double[7]; //stores all highvalues in a single dimensional array//
for (int i = 0; i < 7; i++) //this loop puts all high values of Data(num2↑) into storemax//
{
storeMax[i] = (Data[i, 1]);
//put/populate all of data(num2) [i(global 0,1,2,3,4,5,6,7), index1's(high temps)] into storeMax//
}
double average = ((storeMax[0] + storeMax[1] + storeMax[2] + storeMax[3] + storeMax[4] + storeMax[5] + storeMax[6]) /7);
Console.WriteLine(average);
}
How could I implement a loop to add values of my array; rather than add them manually? (Cant think outside the box)
Create a list, then use List.AddRange() method to add values to this list then use List.ToArray() to get the array needed.
How could I implement a loop to add values of my array; rather than add them manually? (Cant think outside the box)
double average = 0;
for(int i = 0; i< storeMax.length : i++)
{
average += Data[i,1];
}
Console.WriteLine(average);
ScrollViewer Zoom problems
If you don't want your buttons to be scrolled in the ScrollViewer then put them outside of the ScrollViewer rather than on a control inside it.
How can I put checkboxes into an array and use FOR LOOP to add value to a total when a user check the box
Calculate days remaining to a birthday?
Calculate days remaining to a birthday?
current code is for age calculate
int[] monthDay = new int[12] { 31, -1, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 };
// contain birth date
DateTime birthdate = this.birthday.Date.DateTime;
// cntain current date
DateTime currentdate = this.calculateday.Date.DateTime;
int day , year , month;
DateTime d1 = birthdate ;
DateTime d2 = currentdate;
int increment;
if(d1>d2)
{
birthdate = d2;
currentdate = d1;
}
else
{
birthdate = d1;
currentdate = d2;
}
// day calculation
increment = 0;
if(birthdate.Day > currentdate.Day)
{
increment = monthDay[birthdate.Month - 1];
}
/// if it is february month
/// if it's to day is less then from day
if (increment == -1)
{
if(DateTime.IsLeapYear(birthdate.Year))
{
// leap year february contain 29 days
increment = 29;
}
else
{
increment = 28;
}
}
if (increment != 0)
{
day = (currentdate.Day + increment) - birthdate.Day;
increment = 1;
}
else
{
day = currentdate.Day - birthdate.Day;
}
///month calculation
if ((birthdate.Month + increment) > currentdate.Month)
{
month = (currentdate.Month + 12) - (birthdate.Month + increment);
increment = 1;
}
else
{
month = (currentdate.Month) - (birthdate.Month + increment);
increment = 0;
}
/// year calculation
year = currentdate.Year - (birthdate.Year + increment);
age calculator
Hi SENTIL,
Try this: Convert.ToInt32(ValueHere)
--James
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.
NOEXPAND Required in 2012 Enterprise
SQL Server 2012 Enterprise, build 11.0.2332.0. I've created a view that joins two tables, and has a computed column that includes components from both underlying tables. I've created a unique clustered index on the view on two columns, the first of which is the computed column. When I query the view like this:
SELECT * FROM schema.View WHERE ComputedColumn = '<some value>';
the optimizer does not use the view index, but instead goes directly against the underlying tables (slow). If I add WITH (NOEXPAND) to the query, it uses the view index and is very fast. I thought that NOEXPAND should never be required when using Enterprise edition for the view index to be considered. Interestingly, if I simply query for the count(*), the view index is used without specifying NOEXPAND.
What am I missing?
Thanks
Vern Rabe
NOEXPAND Required in 2012 Enterprise
>So to restate my question, is there anything I'm missing that could result in the better plan without forcing it with NOEXPAND?
Apart from ensuring that the appropriate indexes and statistics are in place, it's very dependent on the details of the query.
If you look at the actual execution plan from the un-hinted plan, are the any estimates that are way off?
David
David http://ift.tt/1c5QNcs
Why Webbrowser control does not release memory?
Hi All
I am using Webbrowser control in my c# windows application. I am trying to load different web pages.
But after some time page does not load and give Object reference error, I have found that it does not release memory
after whole process end, I am calling garbageCollertor but not a solution. I have that there is another WebKitBrowser
available, that does it.
How can i release memory after a process complete, Please give me answer soon?
Thanks.
Why Webbrowser control does not release memory?
Hello Amit m:
You can try to Dispose() method.
ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report
Free Tech Books Search
user input and password
Bob - www.crowcoder.com
user input and password
Hello,
It doesn't work because the scope of your variables is incorrect you need to put them above the do keyword, like this.
string username, pass;
do
{
Console.Write("Enter a username: ");
username =Console.ReadLine();
Console.Write("Enter a password: ");
pass = Console.ReadLine();
if (username =="john"&& pass=="mjamaa")
Console.WriteLine("Login Error");
}
while (username =="john"&& pass=="mjamaa");
Console.WriteLine("Login successful");
You have another logical mistake but I'll leave it to you.
Regards,
Eyal Shilony
user input and password
Change your code to:
namespace trial
{
public class Password
{
static void Main(string[] args)
{
Console.Write("Enter a username: ");
string username = Console.ReadLine();
Console.Write("Enter a password: ");
string pass = Console.ReadLine();
do
{
if (username == "john" && pass == "mjamaa")
Console.WriteLine("Login Error");
}
while (username == "john" && pass == "mjamaa");
Console.WriteLine("Login successful");
}
}
}
Regards, http://ift.tt/1e8mnao
user input and password
Bob - www.crowcoder.com
user input and password
Regards, http://ift.tt/1e8mnao
user input and password
Yeah, I agree. But still I prefer to do so because if answer is not accepted, then asker can unpropose it. No harm in that
Do you actually know what you did? look at your code again! it certainly wrong to propose your own answer when the code doesn't even work correctly...
Regards,
Eyal Shilony
user input and password
Change your code to:
namespace trial
{
public class Password
{
static void Main(string[] args)
{
Console.Write("Enter a username: ");
string username = Console.ReadLine();
Console.Write("Enter a password: ");
string pass = Console.ReadLine();
do
{
if (username == "john" && pass == "mjamaa")
Console.WriteLine("Login Error");
}
while (username == "john" && pass == "mjamaa");
Console.WriteLine("Login successful");
}
}
}Regards, http://ift.tt/1e8mnao
Your code doesn't seem to work. Please update it with the correct code. Thanks!
Ed Price, Power BI & SQL Server Customer Program Manager (Blog, Small Basic, Wiki Ninjas, Wiki)
Answer an interesting question? Create a wiki article about it!
user input and password
do
{
if (username == "john" && pass == "mjamaa")
Console.WriteLine("Login Error");
}
while (username == "john" && pass == "mjamaa");
Console.WriteLine("Login successful");
Why Webbrowser control do not release memory?
Hi All
I am using Webbrowser control in my c# windows application. I am trying to load different web pages.
But after some time page does not load and give Object reference error, I have found that it does not release memory
after whole process end, I am calling garbageCollertor but not a solution. I have that there is another WebKitBrowser
available, that does it.
How can i release memory after a process complete, Please give me answer soon?
Thanks.
Why Webbrowser control do not release memory?
Hello Amit m:
You can try to Dispose() method.
ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report
Free Tech Books Search
Manipulate values in dictionary C#
Show us your screenshot, maybe the problem of formation on UI.
Just with your codes, please.
ASP.NET Questions
Other Discussions
FreeRice Donate
Issues to report
Free Tech Books Search
How to calculate totals based on year (date) and comparing othe columns in the same table please
Hello Good Evening,
Could you please help me here
how to write condition for self table year records, such 2012 name and acctno match with 2013 name and acctno then total, provided below,
create table #tab1 (MasterKey int, AcctNo varchar(12),name varchar(25), SumaofShares numeric, request_dat datetime )
--drop table #tab1
insert into #tab1 values (1000, 100,'Tom', 2500, '10/01/2012')
insert into #tab1 values (1001, 101,'Bat', 1550, '08/11/2012')
insert into #tab1 values (1002, 102,'Kit', 1600, '06/12/2012')
insert into #tab1 values (1003, 103,'Vat', 1750, '04/15/2012')
insert into #tab1 values (1010, 104,'Sim',200, '04/21/2013')
insert into #tab1 values (1011, 105,'Tim',500, '06/18/2013')
insert into #tab1 values (1012, 100,'Tom',800, '08/22/2013')
insert into #tab1 values (1013, 101,'Bat',550, '09/15/2013')
insert into #tab1 values (1014, 100,'Pet',200, '02/21/2013')
insert into #tab1 values (1015, 103,'Vat',150, '03/18/2013')
insert into #tab1 values (1016, 110,'Sun',800, '03/22/2013')
insert into #tab1 values (1017, 111,'Bet',550, '12/15/2013')
insert into #tab1 values (9999, 111,'AAA',110, '12/15/2014')
create table #tab2 (IssueKey int, totalOutstanding numeric, sharedBenefits varchar(1) )
--drop table #tab2
insert into #tab1 values (1000, 500, 'V')
insert into #tab1 values (1001, 150, 'U')
insert into #tab1 values (1002, 100, 'N')
insert into #tab1 values (1003, 170, 'U')
insert into #tab1 values (1010, 100, 'U')
insert into #tab1 values (1011, 200, 'K')
insert into #tab1 values (1012, 340, 'U')
insert into #tab1 values (1013, 560, 'N')
insert into #tab1 values (1014, 280, 'V')
insert into #tab1 values (1015, 150, 'V')
insert into #tab1 values (1016, 840, 'V')
insert into #tab1 values (1017, 530, 'N')
i would like to get 4 columns output
how to get sumofshares (#tab1) and TotalOutStanding(#tab2) summ up with these values please.,
MasterKey (#tab1) and IssueKey (#tab2) are like primary key and foreign key
so the request is
need to calculate, sumofshares (#tab1) and TotalOutStanding(#tab2) as below
1)ShareBenefist = U and year( request_dat) in (2012 , 2103) and (Name for 2012 should match with 2013 name and 2012 Acctno should match with 2013 accounno) in (#tab1)
then '2012 and 2013 accts UN Veriverted'
2)ShareBenefist = V and year( request_dat) in (2012 , 2103) and (Name for 2012 should match with 2013 name and 2012 Acctno should match with 2013 accounno) in (#tab1)
then '2012 and 2013 accts Veriverted'
3)ShareBenefist = N and year( request_dat) in (2012 , 2103) and (Name for 2012 should match with 2013 name and 2012 Acctno should match with 2013 accounno) in (#tab1)
then '2012 and 2013 accts NONVERT'
4)year( request_dat) =2102 and Name and Acctno not match with 2013 account name and acctno (#tab1)
then '2012 last year accounts'
5)year( request_dat) = 2013 and Name and Acctno not match with 2013 account name and acctno (#tab1)
then '2012 This year accounts'
for ex 1) the below accounts in #tab1 has both 2012 and 2013 and acctno same in both years and name is same in both years so it is condired as
insert into #tab1 values (1012, 100,'Tom',800, '08/22/2013')
for ex 2)
insert into #tab1 values (1013, 101,'Bat',550, '09/15/2013')
for ex 4) 2012 records there is not match acctno and name in 2013 recods
insert into #tab1 values (1002, 102,'Kit', 1600, '06/12/2012')
for ex 5) 2013 records there is no match of name and acct no with 2012 records
insert into #tab1 values (1010, 104,'Sim',200, '04/21/2013')
insert into #tab1 values (1014, 100,'Pet',200, '02/21/2013')
insert into #tab1 values (1016, 110,'Sun',800, '03/22/2013')
insert into #tab1 values (1017, 111,'Bet',550, '12/15/2013')
Expected Results (just for format)
AcctTypeDescription, SumofShares, OtotalutStand
'2012 and 2013 accts UN Veriverted',2700,234
'2012 and 2013 accts Veriverted' ,2890,234
'2012 and 2013 accts NONVERT' ,4533,325
'2012 last year accounts' ,2334,567
'2012 This year accounts' ,2222,877
Please
Thank youy in advance
asita
How to calculate totals based on year (date) and comparing othe columns in the same table please
Could somebody help me,
any idea on how to join
the same table to compare accountno and name for 2012 and 2013
Thanka
ton in advance
asita
How to use an indicator on SSRS 2008?
Please set below expression in Indicator's color property
=IIF(Fields!Percentcol.Value >= 90, "Green", "Red")
where percentcol is the %tage column in your dataset .
Gaur
sharepoint 2010 foundation signout issue
Before you change it to claim based, you can try these links
This is for MOSS, you can do the same for 2010
Also check http://ift.tt/1fvopFG
Everything about SQL Server | Experience inside SQL Server -Mohammad Nizamuddin
sharepoint 2010 foundation signout issue
Hi Karunanithi,
Below code will clear out all the cookies. Although I have only used this code for Claims Based mode, try and see if it works for you as well:
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
ClientScriptManager cm = Page.ClientScript;
String ulsScript = "function ULSLogout(){var o=new Object;o.ULSTeamName=\"Microsoft SharePoint Foundation\";o.ULSFileName=\"LogOut.aspx\";return o;}";
cm.RegisterClientScriptBlock(this.GetType(), "UlSLogout", ulsScript, true);
String closeBrowser = "function _spBodyOnLoad() {ULSLogout:; try { document.execCommand(\"ClearAuthenticationCache\"); } catch (e) { } window.close(); }";
cm.RegisterStartupScript(this.GetType(), "CloseBrowser", closeBrowser, true);
ScriptManager.RegisterStartupScript(this, this.GetType(), "CloseBrowser", "_spBodyOnLoad();", true);
RemoveCookiesAndRedirect();
}
private void RemoveCookiesAndRedirect()
{
if (this.Context.Session != null)
{
this.Context.Session.Clear();
}
string str = string.Empty;
if (this.Context.Request.Browser[SupportsEmptyStringInCookieValue] == "false")
{
str = "NoCookie";
}
HttpCookie cookie = this.Context.Request.Cookies[CookieWssKeepSessionAuthenticated];
if (cookie != null)
{
cookie.Value = str;
this.Context.Response.Cookies.Remove(CookieWssKeepSessionAuthenticated);
this.Context.Response.Cookies.Add(cookie);
}
HttpCookie cookie2 = this.Context.Request.Cookies[CookieWssKeepAuthenticated];
if (cookie2 != null)
{
cookie2.Value = str;
cookie2.Expires = new DateTime(1970, 1, 1);
this.Context.Response.Cookies.Remove(CookieWssKeepAuthenticated);
this.Context.Response.Cookies.Add(cookie2);
}
SPIisSettings iisSettingsWithFallback = SPsite.WebApplication.GetIisSettingsWithFallback(SPsite.Zone);
if (iisSettingsWithFallback.UseClaimsAuthentication)
{
FederatedAuthentication.SessionAuthenticationModule.SignOut();
int num = 0;
using (IEnumerator<SPAuthenticationProvider> enumerator = iisSettingsWithFallback.ClaimsAuthenticationProviders.GetEnumerator())
{
while (enumerator.MoveNext())
{
SPAuthenticationProvider current = enumerator.Current;
num++;
}
}
if ((num != 1) || !iisSettingsWithFallback.UseWindowsIntegratedAuthentication)
{
SPUtility.Redirect(BaseWebpart.FBA_Next_Step, SPRedirectFlags.Default, this.Context);
}
}
else if (AuthenticationMode.Forms == SPSecurity.AuthenticationMode)
{
FormsAuthentication.SignOut();
SPUtility.Redirect(BaseWebpart.FBA_Next_Step, SPRedirectFlags.Default, this.Context);
}
else if (AuthenticationMode.Windows != SPSecurity.AuthenticationMode)
{
throw new SPException();
}
SPUtility.Redirect("/_layouts/signout.aspx", SPRedirectFlags.DoNotEncodeUrl, this.Context);
}
Cheers,
Vincent
sharepoint 2010 foundation signout issue
Hi Vincent,
are you deploying this change as a coded sandbox solution? in which case, how would you go about this in 2013 via javascript?
Thursday, January 30, 2014
SSRS reports using MS Access Database
Hi All,
I have Created SSRS reports in Sql Server 2008 R2 using MS Access 2003(.MDB) database. I have deployed this reports on Share Point 2010 Document library successfully. But When I click on report which present on library, it just show me "LOADING" message.
Is there any need to do some additional setting in sharepoint or access to show my reports. Please suggest me, why share point showing "LOADING" message. I have checked in sharepoint log. I did not get any usefull information from there.
Thanks in advance.
Muliple values needed
1. select v_FullCollectionMembership.CollectionID As 'Collection ID', v_Collection.Name As 'Collection Name', v_R_System.Name0 As 'Machine Name' from v_FullCollectionMembership
JOIN v_R_System on v_FullCollectionMembership.ResourceID = v_R_System.ResourceID
JOIN v_Collection on v_FullCollectionMembership.CollectionID = v_Collection.CollectionID
Where v_R_System.Name0 in (@Comp )
2. On Propreties of the parameter check (Allow multiple values)
Muliple values needed
Thanks. This works with an empty drop down.
But I would like to have all the Client Maschines in the drop down now. That's what I select based on my query
Muliple values needed
Yes this helps to get the Default value away. This is fine now.
But still I only see one result in the Report, (see printscreen above) even if I select several MaschineNames in the drop down.
Thanks for your support!
Muliple values needed
Hi Sofya
Alright. Hope to get a solution soon.
Guess the Reporting Services will be the right forum.
Thanks,
Al
Runing Background Application with System Clcok parameters
Hi Edilasio,
I recommend you use BackgroundWorker. See a code sample in the following link. http://ift.tt/1cBD0Pr.
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.
Please explain it!
Hi,Can you explain this piece of code?
I'm confused!
Why we are for each compare new instance of 'CaseInsensitiveComparer'?
What is ObjectDumper?!
ublic void Linq36()
{
string[] words = { "aPPLE", "AbAcUs", "bRaNcH", "BlUeBeRrY", "ClOvEr", "cHeRry" };
var sortedWords =
words.OrderBy(a => a.Length)
.ThenBy(a => a, new CaseInsensitiveComparer());
ObjectDumper.Write(sortedWords);
}
public class CaseInsensitiveComparer : IComparer<string>
{
public int Compare(string x, string y)
{
return string.Compare(x, y, StringComparison.OrdinalIgnoreCase);
}
}
Please explain it!
Hi Arash,
ObjectDumper classlibrary takes a normal .NET object and dumps it to a string, TextWriter, or file. Handy for debugging purposes.You can download the objectDumper project from here.
SRIRAM
Please explain it!
Why we are for each compare, we create new instance of 'CaseInsensitiveComparer'?
How to implement this in SQL?
marser,
check if this works fr yu:
declare @tab1 table( id1 varchar(2),id2 varchar(2),val int)
declare @tab2 table(id varchar(2))
insert @tab1 select 'A','B',10
insert @tab1 select 'A','C',10
insert @tab2 select 'B'
insert @tab2 select 'C'
insert @tab2 select 'D'
select ISNULL(t1.id1,'A') as id1,t2.id,t1.val
from @tab1 t1
full outer join @tab2 t2 on t1.id2=t2.id
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
How to implement this in SQL?
use a logic like below
SELECT t1.field1,
t2.field2,
t11.field3
FROM (SELECT DISTINCT Field1 FROM t1)t1
CROSS JOIN (SELECT DISTINCT Field2 FROM t2) t2
LEFT JOIN t1 t11
ON t11.field1 = t1.field1
AND t11.field2 = t2.field2
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c
How to implement this in SQL?
create table table1 (Field1 char(1),field2 char(1),Field3 int)
insert into table1 values('A','B',10),('A','c',20)
create table table2 (Field2 char(1))
insert into table2 values('B'),('C'),('D')
select t.field1,t.field2,t1.field3 from (select distinct a.Field1,b.Field2 from table1 a,table2 b) t
left join table1 t1 on t.field1=t1.field1 and t.field2=t1.field2
How to implement this in SQL?
marser,
another method :)
select ta.id1,tb.id,tc.val from
(select distinct id1 from @tab1) ta
cross join
(select id from @tab2) tb
left join @tab1 tc on ta.id1=tc.id1 and tb.id=tc.id2
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
Using Narrator in My Windows 8 App
Hello there,
Can I in any way use Narrator to narrate the content of my app to the user as he or she clicks a button. Please provide me with a sample if possible.
Regards
SSRS 2012 some users are not able to edit reports in the server
They should try the following:
- Open Report Builder 3.0 on their client machine.
- Click the round button at the top left corner of the window, and select Options.
- Where there is "Use this report server or SharePoint site by default:", type in the URL to a SharePoint site with Reporting Services features.
- Click OK, then at the bottom left of the application, there is "Current report server: ____ Disconnect".
- Click Disconnect, then Connect again. You might get a window to confirm the new report server, make sure it is the SharePoint one and click OK.
Does that work or give you a different error?
How to implement this in SQL?
marser,
check if this works fr yu:
declare @tab1 table( id1 varchar(2),id2 varchar(2),val int)
declare @tab2 table(id varchar(2))
insert @tab1 select 'A','B',10
insert @tab1 select 'A','C',10
insert @tab2 select 'B'
insert @tab2 select 'C'
insert @tab2 select 'D'
select ISNULL(t1.id1,'A') as id1,t2.id,t1.val
from @tab1 t1
full outer join @tab2 t2 on t1.id2=t2.id
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
How to implement this in SQL?
use a logic like below
SELECT t1.field1,
t2.field2,
t11.field3
FROM (SELECT DISTINCT Field1 FROM t1)t1
CROSS JOIN (SELECT DISTINCT Field2 FROM t2) t2
LEFT JOIN t1 t11
ON t11.field1 = t1.field1
AND t11.field2 = t2.field2
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c
Confusion with a query
simkaur,
Have a left join with patient acoount - so irrespective of whether matching rows exist in patient_account or not, the rest of the setup wont be affected :)
something like:
select p.col_name1,m.col_name2
from patient p
inner join message m on p.patient_GUID=m.patient_GUID
left join patientaccount pa on p.patient_GUID=pa.patient_GUID
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
Confusion with a query
What you need is a left join.
select * from Patient
join Message on Patient.GUID = Message.PatientGUID
left join PatientAccount PA
On PatientAccount.someid=Patient.someid
where Message.GUID = Data
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
Runing Background Application with System Clcok parameters
Runing Background Application with System Clcok parameters
Hi Edilasio1,
I am moving your thread into the VC# Forum for dedicated support. Thanks for your understanding.
Have a nice day,
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.
How to store data of c# app of Windows 8.1 in Visual Studio 2013 ?
Hi
Kindly refer the following links for using sqlite installation
http://ift.tt/1khIyQS
http://ift.tt/1bc3FkS
Here. Without installation sqliteruntime we are able to add WinrtSqlite.dll as a reference to your project.Use the below link
http://ift.tt/1khIz76
how to get files from sub-folders using "GetFilesAsync()" method
There seems to be nothing wrong at all with this C# code.
Maybe the problem is in the corresponding XAML, like a textblock that has the wrong foreground color, or that is covered by another control, or that is out of screen.
how to get files from sub-folders using "GetFilesAsync()" method
how to get files from sub-folders using "GetFilesAsync()" method
You're actually not fetching the files from the selected folder itself.
Add this after "StorageFolder folder = await op.PickSingleFolderAsync();":
IReadOnlyList<StorageFile> rootFiles = await folder.GetFilesAsync();
foreach (StorageFile file in rootFiles)
{
TextBlock1.Text += file.DisplayName.ToString() + Environment.NewLine;
}
how to get files from sub-folders using "GetFilesAsync()" method
FTP Connection error : 530 user cannot log in, but able to login using WinSCP using same credential
Hi EveryOne,
We have a File Watcher task in SSIS which is developed in C# langiage. The main functionality of the task is to look for some specific files in FTP. If files are found, check the file size, wait for 1 minute and agian recheck the filesize. If the file size is same then start another process which will do a further processing of this file.
To look for specific files in the package, all files from FTP are loaded to array and it is compared to the list of files which has to be present. Till here its working perfectly fine.
Now if the file from FileList exists in FTP, file size has to be determined.
For this below code has been written:
public String ftpConn()
{
String fleLst = searchFilesFtp();
String ftpserver = "http://ift.tt/1bbVdin;;
String ftpDirectory = "reports/";
String url = ftpserver + ftpDirectory;
String[] file = fleLst.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < ((ICollection)file).Count; i++)
{
long InitiSize = 0;
long FinalSize = 0;
FtpWebRequest reqSize = (FtpWebRequest)FtpWebRequest.Create(url + file[i]);
reqSize.Credentials = new NetworkCredential(@"usr", "pwd");
reqSize.UseBinary = true;
reqSize.UsePassive = true;
reqSize.KeepAlive = false;
long size = 0;
reqSize.Method = WebRequestMethods.Ftp.GetFileSize;
try
{
//error is in below code : "530 user cannot log in"
FtpWebResponse loginresponse = (FtpWebResponse)reqSize.GetResponse();
FtpWebResponse respSize = (FtpWebResponse)reqSize.GetResponse();
respSize = (FtpWebResponse)reqSize.GetResponse();
size = respSize.ContentLength;
respSize.Close();
}
catch (Exception e)
{
String err = e.Message;
}
while (true)
{
if (size > 0 && InitiSize > 0)
{
if (InitiSize == FinalSize)
{
fileCount_Act++;
break;
}
else
{
FinalSize = InitiSize;
// System.Threading.Thread.Sleep(60000);
}
}
InitiSize = size;
}
}
return fleLst;
}
Can some one please let me know why this error is happening and how can we resolve it.
I am able to connect to FTP using the above credentials in WinSCP.
NOTE: We have another file watcher task with same code, but for different FTP site. Its working perfectly fine there. I am not sure what exactly is the problem here.
Thanks in advance
Raksha
FTP Connection error : 530 user cannot log in, but able to login using WinSCP using same credential
Hi Raksha,
I assume there is something wrong in the server. Please refer to the following link for details. http://ift.tt/1bbVd1T.
Hope useful.
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.
data bound visual cue
I want to set the background color of a listview item based on a property of the data binding class. The property changes dynamically. For instance, the list is of songs, the currently playing song needs to have a different background color. I found the following on stackoverflow:
This appears to demonstrates the effect I required, except that it doesn't work in Windows Store App because it uses Triggers, not VSM. Is there an equivalent to this in VSM?
Thanks
data bound visual cue
Thanks Anne,
I appreciate the response, but I have to say I am very disappointed. Of course you understand that White is not necessarily the background color of every ListViewItem.Background. So what you are saying is that I have to couple what should be a general property binding IValueConverter with a specific instance of a ListView through a shared resource, i.e. the value White?
If this is true, I have to say, the fact that what I am trying to do is relatively trivial in WinForms, WTL, VB6, pretty much every other Windows UI Framework, and appears to be impossible without direct coupling in XAML/C# is very disappointing.
data bound visual cue
Hi,
I'm sorry i do not understand what you mean? Could you describe in detail. Do you want to make the Paremeter bind to a source.If so, you can refer to the link:
Best Wishes!
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. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.
data bound visual cue
Ok, I'm still struggling with this. IValueConverter does solve half the problem, the other half is the runtime dynamic nature of the property change.
In my example (in the OP), I have a list of songs bound, for instance, to a ListView. The property IsPlaying is changed in the code-behind when the currently playing songs ends and the next one begins.
From the documentation I have read I have three options:
1) Dependency Object / Dependency Property
2) INotifyPropertyChanged
3) ObservableCollection
And these are my results, so far:
1) Dependency Property does not trigger a refresh of the UI
2) I cannot figure out who/what should handle the PropertyChanged event in order to trigger a UI refresh (especially since I cannot find a function exposed by a xaml ui element which would cause it to refresh)
3) I haven't even gotten into ObservableCollection, too many reams of documentation already have left me drowning and gasping for air.
Website copying
FIll in missing months
Jay,
Your code is good, but the OP probably wanted to get total distance in case the rider run a few times in a month. It would be a simple change in your code though.
For every expert, there is an equal and opposite expert. - Becker's Law
My blog
My TechNet articles
MessageDialog.ShowAsync: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
Where is this code running? Is it on the UI thread or in a worker? Do you already have another MessageDialog up and visible?
--Rob
Selecting a Parameter using LIKE keyword
WebBrowser Control has memory problem.
Hi Everyone,
I am using WebBrowser control in my c# window application, I am loading Multiple web pages one after one.
After some time webpage not loaded and document is null. I have check there is too much memory in used.
How can i solve this issue?
I called Garbage Collertor focefully, But still same issue.
FIll in missing months
Dave,
The code I posted does give the necessary month number and the distance as 0 right?
Thanks,
Jay
<If the post was helpful mark as 'Helpful' and if the post answered your query, mark as 'Answered'>
Selecting a Parameter using LIKE keyword
I am selecting using teh following Where clause:
WHERE (SS.statusName = 'Signed Off' OR SS.statusName = 'Closed') AND S.receivedFromTypeID = '1' AND (S.submissionDetails LIKE '%' + @Keyword + '%')
ORDER BY M.meetingDate, S.agendaNo
The only parameter that is passed in is for @Keyword, but the LIKE does not seem to be working for this.
Anyone know why?
Selecting a Parameter using LIKE keyword
the posted statement looks fine to me
Can you explain what you mean by LIKE doesnt seem working
Please give an example of value you passed and output you expected for it
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c
Selecting a Parameter using LIKE keyword
Hi JMcCon
Please modify your condition as below
select * form tablename where columnname like '%'+@Criteria+'%'
Selecting a Parameter using LIKE keyword
Hi, JMcCon
It look's fine, why u think it's does not working...
Declare @test nvarchar(10)
set @test='Abcde'
select * from table_name where column_name like '%'+@test+'%'
its working.....
Selecting a Parameter using LIKE keyword
None of these have worked.
If I have ... = @Keyword then this works fine but I want to change it to LIKE instead of = which just won't seem to work.
How can i display the cnn rss news feeds ?
Well below is a VB.Net link that you could look at.
RSS Feed Link Reader in VB.NET
Please BEWARE that I have NO EXPERIENCE and NO EXPERTISE and probably onset of DEMENTIA which may affect my answers! Also, I've been told by an expert, that when you post an image it clutters up the thread and mysteriously, over time, the link to the image will somehow become "unstable" or something to that effect. :) I can only surmise that is due to Global Warming of the threads.
FIll in missing months
alter PROCEDURE dbo.UM_getmonthlymiles
-- Add the parameters for the stored procedure here
@YEAR INT , @RIDER INT
AS
BEGIN
declare @months table
(
monthnum int
--, mnthname varchar(3)
)
insert into @months
select MonthInt
from (
select 1 as MonthInt union all select 2 union all select 3 union all select 4 union all
select 5 as MonthInt union all select 6 union all select 7 union all select 8 union all
select 9 as MonthInt union all select 10 union all select 11 union all select 12
)M
--select* from @months
declare @mnthmiles table
(
distance float
, riderid int
--, mnthname varchar(10)
, monthnumber int
)
select isnull(sum(mi.distancemiles),0), @RIDER, isnull(month(mi.ridedate),m.monthnum) MonthNum
from mileagelog mi
RIGHT JOIN @months M
ON M.monthnum = month(ridedate)
and isnull(riderid ,@rider)= @rider
group by DATEPART(mm,ridedate), riderid, DATENAME(mm,ridedate), DATEPART(mm,ridedate), M.monthnum
order by DATEPART(mm,ridedate), M.monthnum
end
Satheesh
My Blog
Wednesday, January 29, 2014
Can't access KnownFolders from Windows Store app
Corrado Cavalli [Microsoft .NET MVP-MCP]
UGIdotNET - http://ift.tt/1gpoBJH
Weblog: http://ift.tt/1mWmfj6
Twitter: http://ift.tt/1gpoBJI
How create animated power view reports using sharepoint list as a data source in sharepoint 2010?
Hi All,
I got a client requirement to create reports using SharePoint List as data source. The report should show reflection depends on values changed (I mean animation).
I have heard about the power view/power pivot which does this kind of animations in reports.
Can someone please guide me on creating reports which shows animations
- In power view/power pivot using SharePoint List as data source in SharePoint 2010.
Thanks in advance.
MercuryMan
Page Break in subreport is ignored
Hi,
As per my requirement, I created 3 subreports, in which one subreport have a tablix and pagebreak after each row. My problem is, I have to display the remainig 2 subreports, one as header and another like footer in each page of the tablix data.
I tried using a table and kept these three reports as 3 rows,then it is displaying the 1st row in first page and 3rd row in last page.
Thn I tried grouping of the column using colgroup, the pagebreak of subreport is not working.
Any suggessions??????????
Save SSRS Report as .PDF in Client Machine
You can use below snippet.
string strURL=path;
WebClient req=new WebClient();
HttpResponse response = HttpContext.Current.Response;
response.Clear();
response.ClearContent();
response.ClearHeaders();
response.Buffer= true;
response.AddHeader("Content-Disposition","attachment;filename=\"" + Server.MapPath(strURL) + "\"");
byte[] data=req.DownloadData(Server.MapPath(strURL));
response.BinaryWrite(data);
response.End();
Bala
Event Receiver ItemUpdating or ItemUpdated for Folders
Hi Esther,
What type of library you have created ?
Event Receiver ItemUpdating or ItemUpdated for Folders
How can I calculate % Change in Pivot using CTE ?
If you want to Round to the nearest integer (that is -20.45 becomes -20 and 4.91 becomes 5), then
Cast(Round(([2012]-[2011])/Cast([2011] As decimal(9,2))*100, 0) As int)
If you want to truncate the decimal (that is -20.45 becomes -20 and 4.91 becomes 4), then
Cast(([2012]-[2011])/Cast([2011] As decimal(9,2))*100 As int)
Tom
WebView DoubleTapped-Tapped event
This is a by-design behavior. Basically the HTML page handle all the click events and the input will not bubbling to XAML, for this reason, the tap or double tap event cannot be fired.
If you need to display an additional panel after double click on the WebView, I think this API could be useful: ScriptNotify event, you could monitor the double click event on HTML by JavaScript and passing the event out to XAML.
If you are working with 8.0 App, this blog article should help you a lot: http://ift.tt/1gsA235
<THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
Thanks
MSDN Community Support
Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.
calling a detail report from multiple summary reports
There are three summary reports. i want to create one detail report which can be called from all three summary reports. Now, all these summary reports have different context of data. for eg: first is billing report, second is trading report,third is expense report. So, all these may have different set of data. One option could be that i include all the data from three reports in to one detail report and hide/unhide columns based on which summary report calling the detail report. However this is easier approach but it's lot of configurations needs to be done. Is there any other approach?
calling a detail report from multiple summary reports
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://ift.tt/19nLNVq http://ift.tt/1iEAj0c
calling a detail report from multiple summary reports
ok, but still in my detail report, i'll have to hide/unhide the columns based on which summary report is calling the detail report.
Is there any thing which we can do dynamically?
How to use If condition in SSRS?
Hi,
I want to find out if N_Dt and O_Dt is same then disply it or leave it blank in SSRS for one field value.
For this I am using below expression,
=IIf(Fields!N_DT.Value = Fields!O_DT.Value, Fields!N_DT.Value, "")
but this is not working and it is showing me as #error.
Can someone please check and let me know what I am doing wrong or is there any other solution? Thanks.
Vicky
How to use If condition in SSRS?
Is it date or text fields ? Fields!N_DT.Value = Fields!O_DT.Value
Try using TRIM function on both side. If it is a date then you can try DateDiff(......) = 0
Regards, RSingh
Open PDF/Word/Image files in respective softwares in sharepoint 2010
Hello,
Have you considered developping an ActiveX control?
Open PDF/Word/Image files in respective softwares in sharepoint 2010
Dear Omkar,
Thank you so much for your reply.
I have to achieve this using coding. My image button is inside a gridview. When I click the image button from the page it should open the document in PDF/Word reader.
I have written the below code, but since the code resides in server, when iam clicking the image button from client side, the document is not opening. This is getting opened in the server and I could see the process running under processes tab of the task manager.
<asp:GridView ID="gridview1" runat="server" AutoGenerateColumns="False"
OnRowDataBound="gvIdentify_Databound" OnRowCommand="gvIdentify_RowCommand" >
<HeaderStyle BackColor="#4b6985" ForeColor="#ffffff" />
<AlternatingRowStyle BackColor="#e7f0f9" />
<Columns>
<asp:TemplateField HeaderText="Status of the artifact">
<ItemTemplate>
<asp:ImageButton ID="lnkDigit" runat="server" CommandName="DigitImageClick" CommandArgument='<%#Bind("Asset_ID")%>' CausesValidation="false"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
on row databound i wrote the below code
protected void gvIdentify_RowCommand(object sender, GridViewCommandEventArgs e)
{
try
{
if (e.CommandName == "DigitImageClick")
{
clsImpersonation objImp = new clsImpersonation();
string impUserName = ConfigurationSettings.AppSettings["impUserName"];
string impPassword = ConfigurationSettings.AppSettings["impPassword"];
string impDomain = ConfigurationSettings.AppSettings["impDomain"];
if (objImp.impersonateValidUser(impUserName, impDomain, impPassword))
{
string strPDFFile = @"\\ServerName\MyFolderName\Test\OctoberTest.pdf";
System.Diagnostics.Process.Start(strPDFFile);
}
objImp.undoImpersonation();
}
}
catch (Exception ex)
{
throw ex;
}
}
Open PDF/Word/Image files in respective softwares in sharepoint 2010
Dear Nicolas,
Thank you so much for your reply. I have never worked in ActiveX control. Kindly guide me on how to create an ActiveX control to achieve my requirement.
Thanks
Suresh Kumar Gundala
Changing .NET target framework makes my code doesn't work.
1.The type or namespace name 'Tasks' does not exist in the namespace 'System.Threading' (are you missing an assembly reference?)
my code used -> using System.Threading.Tasks;
2.The primary reference "Microsoft.CSharp", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v3.5". To resolve this problem, either remove the reference "Microsoft.CSharp" or retarget your application to a framework version which contains "Microsoft.CSharp".
Any solution??
thanks..
I'm Okie Eko Wardoyo Owner of http://ift.tt/1iNDXrr
how to check the previous records and after records
I am not able to clearly understand the question, a sample data (insert script would be great) and expected results would help us understand the requirement easily
and what is the SQL Version you are using ?
Satheesh
My Blog
FIll in missing months
I am querying a table that includes the rider id, the date of the ride and the distance. Problem is that they may not have ridden I In a given month, so I want to include that month with a distance of 0, so all twelve months are listed. Here s my attempt... however it doesn't pick up the zero moths.
alter PROCEDURE dbo.UM_getmonthlymiles
-- Add the parameters for the stored procedure here
@YEAR INT
, @RIDER INT
AS
BEGIN
declare @months table
(
monthnum int
--, mnthname varchar(3)
)
insert into @months
select MonthInt
from (
select 1 as MonthInt union all select 2 union all select 3 union all select 4 union all
select 5 as MonthInt union all select 6 union all select 7 union all select 8 union all
select 9 as MonthInt union all select 10 union all select 11 union all select 12
)M
select* from @months
declare @mnthmiles table
(
distance float
, riderid int
--, mnthname varchar(10)
, monthnumber int
)
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
insert into @mnthmiles
select isnull(sum(distancemiles),0), @RIDER, isnull(DATEPART(mm,ridedate), M.monthnum)--) --as [num}
from mileagelog
LEFT JOIN @months M
ON M.monthnum = DATEPART(mm,ridedate)
where DATEPART(yyyy,ridedate) = @year
and riderid = @rider
group by DATEPART(mm,ridedate), riderid, DATENAME(mm,ridedate), DATEPART(mm,ridedate), M.monthnum order by DATEPART(mm,ridedate), M.monthnum
select * from @mnthmiles
FIll in missing months
declare @months table
(
monthnum int
--, mnthname varchar(3)
)
insert into @months
select MonthInt
from (
select 1 as MonthInt union all select 2 union all select 3 union all select 4 union all
select 5 as MonthInt union all select 6 union all select 7 union all select 8 union all
select 9 as MonthInt union all select 10 union all select 11 union all select 12
)M
declare @rider table(id int, rdt date, distance int);
insert into @rider values
(1, dateadd(m,-5,Getdate()),200),
(1, dateadd(m,-4,Getdate()),500),
(1, dateadd(m,-2,Getdate()),100),
(1, dateadd(m,-1,Getdate()),1000),
(1, dateadd(m,0,Getdate()),100),
(1, dateadd(m,2,Getdate()),550),
(1, dateadd(m,4,Getdate()),560);
with cte as
(select distinct id as riderid, m.monthnum from @rider r ,@months m )
select * from cte c left join @rider r on c.riderid=r.id and c.monthnum=month(r.rdt)
Satheesh
My Blog
bitmap decodepixelwidth scale down only
C# limitation in real-time computing
Because most versions of Windows don't actually support real-time applications, no matter what language they're written in...
I think that Windows CE is the only real-time version of Windows.
C# limitation in real-time computing
As the documentation for the Windows API Sleep() says:
This function causes a thread to relinquish the remainder of its time slice and become unrunnable for an interval based on the value of dwMilliseconds. The system clock "ticks" at a constant rate. If dwMilliseconds is less than the resolution of the system clock, the thread may sleep for less than the specified length of time. If dwMilliseconds is greater than one tick but less than two, the wait can be anywhere between one and two ticks, and so on. To increase the accuracy of the sleep interval, call the timeGetDevCaps function to determine the supported minimum timer resolution and the timeBeginPeriod function to set the timer resolution to its minimum. Use caution when calling timeBeginPeriod , as frequent calls can significantly affect the system clock, system power usage, and the scheduler. If you call timeBeginPeriod , call it one time early in the application and be sure to call the timeEndPeriod function at the very end of the application.
However, it's possible to make the system clock run at a higher resolution. Doing that affects the system clock for ALL applications! Some applications such as Windows Media Player change the system clock setting, so if you do some timings while running Windows Media Player, you will see an increased Sleep() resolution. Yeah, it's horrible.
Anyway, here's some sample code. To run it, replace the contents of a default console app's "Program.cs" file with the following code. Run the program WITHOUT Windows Media Player running (or WinAmp or any other media player). Then run it again while Windows Media Player is running. Note how it uses the Windows API function "timeBeginPeriod" to adjust the system clock resolution.
Interesting. :)
using System;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
namespace Test
{
public static class Program
{
public static void Main(string[] args)
{
Stopwatch sw = new Stopwatch();
for (int i = 0; i < 10; ++i)
{
sw.Reset();
sw.Start();
Thread.Sleep(50);
sw.Stop();
Console.WriteLine("(default) Slept for " + sw.ElapsedMilliseconds);
TimeBeginPeriod(1);
sw.Reset();
sw.Start();
Thread.Sleep(50);
sw.Stop();
TimeEndPeriod(1);
Console.WriteLine("(highres) Slept for " + sw.ElapsedMilliseconds + "\n");
}
}
[DllImport("winmm.dll", EntryPoint="timeBeginPeriod", SetLastError=true)]
private static extern uint TimeBeginPeriod(uint uMilliseconds);
[DllImport("winmm.dll", EntryPoint="timeEndPeriod", SetLastError=true)]
private static extern uint TimeEndPeriod(uint uMilliseconds);
}
}
C# limitation in real-time computing
(1) Windows Media Player actually has to be playing something for it to increase the timer resolution.
(2) Some browsers also adjust the timer resolution (for example, if they are playing media files).
C# limitation in real-time computing
One point I've not seen mentioned but you need to be aware of is that the Garbage Collector can kick in and so disrupt your carefully crafted timer.
Whether this is a problem depends on the app but that's one reason that .Net is not used for hard real-time applications.
Regards David R --------------------------------------------------------------- "Every program eventually becomes rococo, and then rubble." - Alan Perlis The only valid measurement of code quality: WTFs/minute.
C# limitation in real-time computing
I seriously doubt that any Windows operating system is real time. The .NET framework and all that happens behind the scenes isn't a real time framework.
Lets put it into context. Would you want to sit on a life support machine running a .NET heart monitoring application on Windows?
Didn't think so
Whether or not it's a .Net application is kindof irrelevent though, since any Windows app can hang up for relatively long periods (in terms of real-time responses) for all sorts of reasons.
You may doubt that any Windows operating system is real time, but:
(Oh, by the way - I've worked writing Medical Diagnostic Applications for the past 19 years, and most heart monitoring systems do NOT need to be real time. We have developed several in .Net; it doesn't matter if there's, say, half a second delay between something occuring and it appearing on a display. Pacemakers, on the other hand... ;)
C# limitation in real-time computing
I seriously doubt that any Windows operating system is real time. The .NET framework and all that happens behind the scenes isn't a real time framework.
Lets put it into context. Would you want to sit on a life support machine running a .NET heart monitoring application on Windows?
Didn't think so
Whether or not it's a .Net application is kindof irrelevent though, since any Windows app can hang up for relatively long periods (in terms of real-time responses) for all sorts of reasons.
You may doubt that any Windows operating system is real time, but:
(Oh, by the way - I've worked writing Medical Diagnostic Applications for the past 19 years, and most heart monitoring systems do NOT need to be real time. We have developed several in .Net; it doesn't matter if there's, say, half a second delay between something occuring and it appearing on a display. Pacemakers, on the other hand... ;)
Cool.
"The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by exertion of the imagination." - Fred Brooks
C# limitation in real-time computing
C# limitation in real-time computing
No Windows program can be real-time because the NT scheduler is not real-time.
You have to admonish the kernel with a product such as RTX.
C# limitation in real-time computing
No. Managed C++ as the namely blatantly states is still running in the CLR.
You can try calling timeBeginPeriod(1) to help your app but if you need precise timing you cannot use Windows.
how to check the previous records and after records
I am not able to clearly understand the question, a sample data (insert script would be great) and expected results would help us understand the requirement easily
and what is the SQL Version you are using ?
Satheesh
My Blog
App creasing in windows 8 store app or metro style app.
Can you post a link to the dump?
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.
App creasing in windows 8 store app or metro style app.
Hi Matt,
ThanQ for your reply. I am not understand what are you asking?
ThanQ
Ganesh
App creasing in windows 8 store app or metro style app.
Matt Small - Microsoft Escalation Engineer - Forum Moderator
If my reply answers your question, please mark this post as answered.
NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.
App creasing in windows 8 store app or metro style app.
Hi Matt,
ThanQ once again for your reply. This is inform you that I am only getting this in the log file.This only happens on one of my computers. On other computers things are working good.Please help.
ThanQ
Ganesh
App creasing in windows 8 store app or metro style app.
Hi All,
I am waiting for your valuable reply.Please help me ASAP.
ThanQ
Ganesh
Using Narrator in My Windows 8 App
Hello there,
Can I in any way use Narrator to narrate the content of my app to the user as he or she clicks a button. Please provide me with a sample if possible.
Regards
Delete SharePoint list all items using C# WPF Application
Hi Shimam,
You can make use of the Sharepoint client object model to perform any operations on the SharePoint list, in your case deleting the list item.
using SP client object model
using System;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointServices.Samples
{
class DeleteListItem
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements");
ListItem oListItem = oList.GetItemById(2);
oListItem.DeleteObject();
clientContext.ExecuteQuery();
}
}
}
The below link contains code to create, update or delete list item.
using Webservice
You also make use of SharePoint webservice to delete bulk items from Sharepoint list, you will send the below request to the webservice.
<Batch OnError="Continue" ListVersion="1"
ViewName="270C0508-A54F-4387-8AD0-49686D685EB2">
<Method ID="1" Cmd="Delete">
<Field Name='ID'>2</Field>
</Method>
</Batch>
In above case you will pass the id of the list item to be deleted.
Full code reference;
SRIRAM