w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
System services for windows phone
You can't make system services on Windows Phone. The best you can do is a background agent, that will be executed once every 30 minutes. You can also, on Windows Phone 8, use the GeoLocator to keep your application alive in the background (it's supposed to be used only for position-tracking purpose though). But none of these workarounds allow you to react to system events, like the phone startup.

Categories : C#

How to solve System.DateTime does not contain a definition for TryParseExact" on Windows CE and C#
Checkout this explanation, it shows how to make your own tryparse, because compact framework does not have it's own. http://www.yortondotnet.com/2009/11/tryparse-for-compact-framework.html

Categories : C#

Issue to get current system datetime dynamically using windows service
The answer to this forum question says: If your Windows Service is running under the SYSTEM account or other account without a profile it will use the settings defined under the HKEY_USERS/.DEFAULT/Control Panel/International registry key. You can change these values from Control Panel / Regional and Language Options / Advanced by checking the check box Apply all settings to the current user account and to the default user profile. Also, read more about the issue on this similar question: Why is my CurrentCulture en-GB and my CurrentUICulture en-US.

Categories : C#

changing the system time format on windows 7
I found this link that shows it being done via vb.net but you would have to translate it. or you could compile this to an exe and run it from a shell. http://www.access-programmers.co.uk/forums/showthread.php?t=152624

Categories : C#

Covert c# datetime format to java datetime format
Your format string doesn't match the input date string : // 2013-07-03T19:16:02.3694 <-- date string static SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd"); You need to first parse the date string using the SimpleDateFormat with pattern yyyy-MM-dd'T'HH:mm:ss.SSSSSS and then you can format the Date object with dd-MM-YYYY pattern.Remember MM is for months , mm stands for minutes. String formattedDate = new SimpleDateFormat("dd-MM-YYYY").format( new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSS") .parse(reportItem.getString("AddedTime")));

Categories : C#

System.Windows.Controls.WebBrowser, System.Windows.Threading.Dispatcher, and a windows service
Maybe the Webbrowser Control needs Desktop Interaction for rendering the content: My feeling say that using WPF controls and in particular particulary the Webbrowser-Control (=Wrapper around the IE ActiveX control) isn't the best idea.. There are other rendering engines that might be better suited for this task: Use chrome as browser in C#?

Categories : Wpf

format string in datetime c# to insert in MYSQL datetime column
Your line: string time = Convert.ToDateTime("10-10-2014 15:00:00"); Shouldn't compile. I can only guess that you don't have DateTime as type of your column in SQL Server, you should modify it to keep DateTime and then pass a DateTime type object, not a string.

Categories : C#

Sql query for CONVERT datetime to a different datetime Format in SQL 2005?
http://msdn.microsoft.com/en-us/library/ms187928.aspx check out see Microsoft's explanation on date formats the one you're looking for is 20 or 120 BTW, you should supply with varchar with a number like this varchar(10)

Categories : SQL

Adding date or time in datetime format to another datetime
*This is a method using DateTime:* $begin = new DateTime($start); $finish = new DateTime($end); $difference = $finish->format('U') - $begin->format('U'); // working version $minutesDiff = round(($difference/60), 0); $finalDate = new DateTime(); $finalDate->modify(sprintf('+%s minutes', $minutesDiff)); edit added missing bracket edit2 version without ->diff() method

Categories : PHP

A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll
Have you tried it without the async? Also, the example in the documentation uses EventArgs rather than RoutedEventArgs, but I'm not sure that should cause the exception you're seeing.

Categories : C#

'System.Data.Services.Client.DataServiceContext.Execute(System.Uri)' cannot be inferred from the usage
It means that the Execute<T> T generic argument method cannot be inferred as is. You need to provide some type to the T generic parameter explicitly: _context.Execute<SomeType>(setStateReq);

Categories : C#

How to convert SCORM 2004 session_time format to a usable datetime format in SQL
Just worked out a solution for me. This would need to be put inside a SQL function for me and I would need to finish off the last bit where I decide what format I want. I am only updating around 900 rows and it is a 1 off update so performance isn't an issue. DECLARE @session_time varchar(200) = 'P50Y2M3DT4H5M6S' DECLARE @date varchar(100) = '' DECLARE @time varchar(100) = '' DECLARE @year varchar(20) = '0' DECLARE @month varchar(20) = '0' DECLARE @day varchar(20) = '0' DECLARE @hour varchar(20) = '0' DECLARE @minute varchar(20) = '0' DECLARE @second varchar(20) = '0' -- Remove the P SET @session_time = SUBSTRING(@session_time, 2, LEN(@session_time)-1) -- If we have a T IF PATINDEX('%T%',@session_time) > 0 BEGIN SET @date = SUBSTRING(@session_time, 0, PATINDEX('%T%',@session_

Categories : PHP

asp.net DetailView datetime field format doesn't match the SQL Server format
Check Your PC Date format and enter date of same format in due date if you enters the date time dynamically then use like this DateTime.Now.ToString(yyyy-MM-dd) here yyyy-MM-dd is my date format enter yours format in this and this is for current date you can use it for the date you desired

Categories : C#

Convert Datetime format to varchar format style workaround
Well you can convert both Dates in any format before you compare the two just use any of these: run this and you can select from them, make sure to convert both dates before Comparing Select convert(varchar, GetDate(), 100) as '100 Conversion', convert(varchar, GetDate(), 101) as '101 Conversion', convert(varchar, GetDate(), 102) as '102 Conversion', convert(varchar, GetDate(), 103) as '103 Conversion', convert(varchar, GetDate(), 104) as '104 Conversion', convert(varchar, GetDate(), 105) as '105 Conversion', convert(varchar, GetDate(), 106) as '106 Conversion', convert(varchar, GetDate(), 107) as '107 Conversion', convert(varchar, GetDate(), 108) as '108 Conversion', convert(varchar, GetDate(), 109) as '109 C

Categories : SQL

DateTime to XML format but keep the datatype as datetime
The dateTime object holds the date and time in a way that is independent of any formatting. The output format is chosen when you convert the value to a string. If it comes out as dd:mm:yyyy, that's because it's defaulting to the format used by the country/language configured for your machine. So the answer is, if you want the ISO format (which you refer to as XML format), then the time to request this is at the time you output the dateTime as XML; it's not a property of the date/time value itself.

Categories : C#

'System.Windows.Markup.XamlParseException' occurred in System.Windows.ni.dll
Here is a working proof: File --> New Project --> New Databound Application (wp8) and here is the code: <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> <ListBox x:Name="ContactResultsData" Tap="ContactResults_Tap_1" ItemsSource="{Binding Items}" Height="600" Loaded="ContactResultsData_Loaded_1" Margin="10,0"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal" Margin="0, 20, 0, 0"> <Border BorderThickness="2" HorizontalAlignment="Left" VerticalAlignment="Center" BorderBrush="{StaticResource PhoneAccentBrush}" Margin="5, 0, 0, 0"> <Image Width="48" Height="4

Categories : C#

Javascript datetime format in database format
dateToString : function (unformatted) { if (!unformatted) { return null; } var year = unformatted.getFullYear(); var month = unformatted.getMonth() + 1; var day = unformatted.getDate(); if (month < 10) { month = '0' + month; } if (day < 10) { day = '0' + day; } return [year, month, day].join('-'); } feel free to add time formatting

Categories : Javascript

how to change date format of datetime format in php
I'd certainly hope that date values aren't actually stored in a textual format at all, any more than numbers are. It's a bit like asking the database to store numbers as hex instead of decimal. You should separate the inherent values within the data from the textual format applied to them when you present them. Normally I'd recommend formatting the data at the client side instead (which typically has more user context) but you can specify a format in the SELECT statement as well: SELECT DATE_FORMAT(StartDate, '%d-%m-%y') FROM SomeTable Likewise when inserting or updating data, I would try to use parameterized SQL so that you don't specify dates as text at all - normally the client library should be able to pass the data on to the database in a native binary format. In general, you sho

Categories : PHP

Get custom datetime format from standard format
Here's some code do get the patterns: var c = new CultureInfo("fr-FR"); Console.WriteLine(c.DateTimeFormat.LongDatePattern); Console.WriteLine(c.DateTimeFormat.ShortDatePattern); Console.WriteLine(c.DateTimeFormat.FullDateTimePattern); The result from a console app is the following dddd d MMMM yyyy dd/MM/yyyy dddd d MMMM yyyy HH:mm:ss

Categories : C#

Windows Phone 8 Raw Notification with Windows Azure Mobile Services
I was able to find out from the logs that my code wasn't sending the notification and worked out that it was my method of testing which was causing it and so I've fixed it. I've found out that the insert script only fires when I use the code: private MobileServiceCollection<TodoItem, TodoItem> items; private IMobileServiceTable<TodoItem> todoTable = App.MobileService.GetTable<TodoItem>(); private async void InsertTodoItem(TodoItem todoItem) { // This code inserts a new TodoItem into the database. When the operation completes // and Mobile Services has assigned an Id, the item is added to the CollectionView await todoTable.InsertAsync(todoItem); items.Add(todoItem); } The insert script for example doesn't run if you use Manageme

Categories : C#

.NET Windows Services (WTSSendMessage) : Displays message on XP but not Windows 7
I believe that this maybe part of Windows Messenger that is not present in Windows 7. This link shows why (RPC disabled by default) and possible solution: By default remote RPC is disabled on Windows 7. It can be enabled by setting the 'HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal Server' value 'AllowRemoteRPC' to 1. However, this will only get you another error - 0x721 - which I am guessing is caused by Windows 7 not allowing 'nul' user access. There are several possible ways around this problem but I haven't tried any of them. One approach would be to add credentials from remote machines to the credential cache on the sending machine but I don't know how practical that is. There may be a way to allow 'nul' user access but that is probably not a good idea either. And t

Categories : C#

set datetimepicker format as system date format
"The date/time format is based on the user's regional settings in their operating system." Which means that it should already be in the format that your system is using. Here is a link for the default .net (c#) date time picker, how to set up the format in a specific way: http://msdn.microsoft.com/en-us/library/system.windows.forms.datetimepicker.format.aspx Example: public void SetMyCustomFormat() { // Set the Format type and the CustomFormat string. dateTimePicker1.Format = DateTimePickerFormat.Custom; dateTimePicker1.CustomFormat = "MMMM dd, yyyy - dddd"; }

Categories : C#

Displaying Message Box using .NET Windows Services In Windows 7
The call to WTSSendMessage() specifies WTS_CURRENT_SESSION, which means "show the message box on the current session". When you run as a service, you are on session 0, which is isolated on Windows 7. You surely don't want your message box to show up there! To show up on a regular user's session, you have to provide a non-zero session ID. See the WTSSendMessage() documentation for details.

Categories : Dotnet

Displaying Message Box using .NET Windows Services In Windows 7
As you have discovered, services now run in session 0 which is a non-interactive session. You cannot interact with the interactive user's desktop in the way that you could in XP. You have a couple of options: Call WTSSendMessage to display a message on the interactive desktop. This is fairly basic but may meet your needs. If you really mean ASAP, then this will be the quickest solution. Run a standard desktop application in addition to your service. Have the service communicate with the desktop app using some form of IPC, for example WCF. When the service wants to display information, send messages to the desktop app over your IPC channel, and let the desktop app display them.

Categories : Windows

How to control Windows services using Windows API easily?
Two possible issues you might have run into: You are checking state of service too soon. The ServiceControl returns immediately, without waiting for the service to complete the request. Your service could transition to SERVICE_STOP_PENDING, and in this case you will have to give it some time and check again. There are dependent services in running state. You will have to enumerate dependent services, shut them down first, then stop your service. On #2, there is good explanation with a sample code on MSDN. Here is a quote from the same page: However, if the SCM determines that other running services are dependent on the specified service, it will not forward the stop request. Instead, it returns ERROR_DEPENDENT_SERVICES_RUNNING. Therefore, to programmatically stop such a service,

Categories : C++

Windows Forms: "System.ArgumentException: Parameter is not valid." coming from System stack
Reason: The common reason for this error is that you are passing invalid value as parameter to your function. My assumption is that you are calling your method something like this ApplyCellStyleToEditingControl(getStyleFromSomeWhere); Now in the above example getStyleFromSomeWhere is invalid thus throwing the exception Solution: The best solution here is that when ever you get this exception (and you get email) you send the parameter to yourself as well. This way you can diagnose what are the values of parameter when the exception occurred and diagnose the root cause.

Categories : C#

Font and icons not appearing on Windows phones only
I heard about this problem before, apparently there is an issue present in Windows Phone 8 that prevents custom font-faces from working when html/css are hosted locally. Could you try and host the html/css files externally? Just to see if it makes a difference. I think this is a bug in the current WebBrowser control that's used on WP8 EDIT: See this StackOverflow questions and answers about a similar problem

Categories : CSS

OS X command line java windows appearing
Well who knows what happened to Java but this answer provides the solution: How to set java system properties globally on OS X? i.e. ~/.profile export _JAVA_OPTIONS=-Djava.awt.headless=true

Categories : Java

System.Reflection.TargetParameterCountException' occurred in System.Windows.Forms.dll
I guess The C++/CLI Invoke mistakes your array< String^ >^ for the array< Object^ >^ it expects to hold a parameter list. You should try wrapping your array< String^ >^ inside an array< Object^ >^. array <String^ > ^COM_PORTS = this -> SerialPort ->GetPortNames(); array <Object^ > ^parameters = gcnew array <Object^ >(1); parameters[0] = COM_PORTS; this->Invoke (gcnew WriteCOMPortDelegate(this, &MainForm::WriteCOMPortPannel), parameters);

Categories : Visual C++

How to know details of System.InvalidOperationException in System.Windows.Forms.dll?
Try doing the following: Add a breakpoint in the necessary location Right-click on the breakpoint and click "When hit.." Check the "Print a message" box, and use the tokens that they show to display the information that you want (e.g., calling funciton, stacktrace, thread ID/name, process ID/name, etc.) If you want the program to continue execution after printing the message (i.e. you do not want it to pause on the breakpoint), also check the "Continue Execution" box You will likely want to combine this technique with a try/catch, as has been suggested by others. I do not want to repeat code provided in others' answers, but I would use Brian's try/catch to wrap your calls, and then set the breakpoints using this technique. Note: You can also use this technique and the "breakpoint

Categories : C#

Strings are appearing in uppercase in Windows Phone 8 with Cordova
I am guessing that you began your work on the new app by extending the template onwards. That's a valid strategy, but the template's CSS styles include the following rule: body { text-transform:uppercase; } That effectively causes everything to show in upper case.

Categories : Windows Phone 8

InDesign ScriptUI windows disappearing immediately after appearing
If you run it from ESTK it works. At least in my IDCC. But to make it run from the ID Scripts Panel you have to add: #targetengine'foo'; at the beginning of your script. (or any other targetengine) Be aware that all globals in the #targetengine 'foo' will exist until you close InDesign. So you should wrap your script into a function. Also I would recommend using return instead of exit()

Categories : Javascript

Mac System Services - application "(null)"
Solved this after some serious head scratching today. Apparently the last part of your bundle identifier and the "Port Name" specified in your service settings in the Info.plist file have to match. Otherwise you get this weird error. So basically, if you have the following bundle identifier: com.yourcompany.yourapp Your NSPortName should be yourapp. Otherwise you get the "application is not compatible" error.

Categories : Osx

DateTime Format for .NET
var res = DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture); Read Standard Date and Time Format Strings On MSDN for more information Below is another way of achieving same format Console.WriteLine(date1.ToString("G", CultureInfo.CreateSpecificCulture("en-us"))); // Displays 4/10/2008 6:30:00 AM

Categories : C#

Format DateTime
Try to use this (in your hibernateObject class): @Temporal(TemporalType.TIMESTAMP) @DateTimeFormat(pattern = "yyyy-MM-dd hh:mm:ss") public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this.startDate = startDate; } When you do as you show date object actually has no changes. Only thing that happens: you create String that contains formatted date. So you can specify DateTimeFormat pattern to store date in that pattern instead. Also note, that "hh" string in your date pattern actually will give you value from 1 to 12. It is AM/PM hour. To get 0-24 hours value use "HH" instead (see http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html, "Date and Time Patterns" section)

Categories : Java

How do I convert string date format to datetime date format?
This should do it: SELECT CONVERT(DATETIME, REPLACE('Sept. 23, 2013','.',''), 107) This removes dot in string and converts to datetime format 107. And this returns the string you wanted (MM/DD/YYYY): SELECT CONVERT(VARCHAR(10), CONVERT(DATETIME, REPLACE('Sept. 23, 2013','.',''), 107), 101) For other format types see: http://www.sqlusa.com/bestpractices/datetimeconversion/ and http://www.sql-server-helper.com/tips/date-formats.aspx Edit: It turns out it works for me because of Slovenian locale (Sept.). This one should work in English locale: SELECT CONVERT(VARCHAR(10), CONVERT(DATETIME, SUBSTRING('Sept. 23, 2013', 0, 4) + ' ' + SUBSTRING('Sept. 23, 2013',6,9), 107), 101) As a function.

Categories : Asp Net

how to get system DateTime in webservice
From your error response, I assume that the problem is not in your code, but in the addressing of this method. You're probably trying to parse a string value into a DateTime format, somewhat like this: DateTime date = DateTime.Parse(dateAsString); If the dateAsString variable does not contain a valid date, then the ArgumentException you described will be thrown. You can resolve this by trying to find out what's wrong with the string date you're trying to parse. It could very well be an empty string that's causing the problem. To help you with finding the troublemaker, use DateTime.TryParse to throw a new Exception with some helpful information: DateTime date; if (!DateTime.TryParse(dateAsString, out date) { throw new Exception("Invalid date: " + dateAsString); }

Categories : Asp Net

Date format on reporting services
There are a few things you can do: You can try changing the Language on your report files (Properties - Location - Language) to match the same language on the database. When you pass a parameter to a query, instead of using the parameter value, pass it as an expression like this: =Format(Parameters!Date.Value,"yyyyMMdd") which will convert it to a date format which will be accepted by any language setting on the database.

Categories : Sql Server

IllegalStateException "System services not available to Activities before onCreate()"
Your JSONParser extends activity but it's not an activity. Remove the extends Activity and call it as an object. You'll also need to remove the extends Activity from your InternetCheck class. Then pass your context to the JSONData class and use your InternetCheck class like this public class JsonData extends Activity{ Connect connect = new Connect(); private String url = "url"; static String keys[]; public JsonData(Context context){ InternetCheck netCheck = new InternetCheck(context); } Then in your InternetCheck class accept the context in the constructor and replace all getBaseContext() with your context variable

Categories : Android

C Sharp DateTime Format
Edited To Note: This looks to be a bug with Windows 7. When changing the short date pattern via the control panel, using the "additional settings" tab as in the OP's post, both the CurrentCulture and CurrentUICulture's date separator gets changed as well. When you modify the short date format, it looks like the first non-format character is picked up as the date separator for the current culture. Both CurrentCulture and CUrrentUiCulture are modified to reflect that [unintended] customization. Looks like some [bright] developer made the [unwarranted] assumption that nobody would ever have a short date format that included something like day of the week. Nice catch! Are you going to report the bug to Microsoft? If you use the invariant culture to format dates, etc., user settings won't af

Categories : C#



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.