w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Developing C# Winforms software using SQL Server 2012 in Visual Studio 2012 and running it on other system without installing SQL Server 2012
If you develop an application that use Sql Server 2012 as storage for your data then you need to install it in a way or another. There are numerous versions of Sql Server, like Sql Server Express and LocalDB. In every case you need the bits that supports your coding calls. This magazine article summarizes relevant infos on the various version of Sql Server I suppose that the right product for you is Sql Server LocalDB. A version of Sql Server that could be distributed easily with your application setup and doesn't require a complex installation procedure. However, if you don't foresee the need to escalate you application to a full Client-Server model and you need only a local storage for a single user, you could choose a single file database like Sql Server Compact Edition or SQLite or

Categories : C#

Why doesn't Visual Studio make DateTime a Blue Key word?
DateTime is not a keyword; it is a struct, which is a ValueType, whereas a class is a Reference type. These are not considered primitives, so they are not colored unless you change the color in your VS settings. Technically the keywords int, string, bool, and double are keywords, but they map to their Struct equivalent in the .NET framework. This way an int works the same in VB and C#. So an int maps to Int32 Struct. They are colored blue to mimic primitive types as they are in other languages. Details

Categories : C#

System.NullReferenceException (Visual Studio 2012, ASP.NET)
datakoppling.Svar is never assigned to, so is null. Instead of: datakoppling.Svar.Add(nySvar); Do: datakoppling.Svar = new DbSet<Svar>(); datakoppling.Svar.Add(nySvar);

Categories : Asp Net

Cannot Find System.Web.Hosting in Visual Studio 2012
In references for your project, add a reference to System.Web then in your program use: using System.Web.Hosting;

Categories : C#

Visual Studio 2012 xaml Designer System.BadImageFormatException
I've resolved the issue by Windows Task Manager and ending the process 'Microsoft Visual Studio XAML UI Designer'. In fact some issues are solved by stopping this process. Visual Studio automatically run this a new fresh instance of this process.

Categories : Wpf

System.web.webpages run error after install Visual Studio 2012
You are getting this error because of assembly reference or configuration issues. You can easily fix it by executing the following command in nuget console (Tools -> Library Package Manager -> Package Manager Console). Install-Package AspNetMvc -Version 3.0.20105.0 It will automatically add all the required references and configures it. Once the installation completes, rebuild and publish the application. If you're using Visual Studio 2010 SP1, you can right click on the project and select "Add Deployable Assemblies". Select the ASP.NET MVC 3 option. That'll add the MVC assemblies to a special directory which will ensure they are in the bin directory when building/publishing your web application. Source

Categories : C#

Highlight data point on line-chart based on datetime interval (within half day) c# - Visual Studio 2008
I figured it out! From where I left off in the preceding code, I first determined what my CursorX position values were outputting, which was OADate. Once I knew this, I constructed a foreach statement (as provided below) for each one of my series: first initializng the visual-attributes of the data points (pt), then checking if a data point fell within a 0.9 day interval centered on the cursor (CursorX-0.4 < pt < CursorX+0.5) and if so, change the marker type/size. I then used the same foreach (and enclosed if statement) for each of my 4 series on the chart, changing only the index of the series. So this hops between series to whichever datapoint falls within the selected range, and also selects multiple datapoints in multiple series if they should fall on the same date.

Categories : C#

Why method now in Python is obtained as datetime.datetime.now instead of datetime.time.now?
"Now" is a point in time. That means date matters; if it's noon now, yesterday noon is not also now. (Time of day also matters; 9 AM today is also not now.) Thus, it makes sense to have a datetime.datetime.now, but not a datetime.time.now. It could make sense to have a datetime.time.currentlocaltime or datetime.time.currentutctime, but those methods don't exist. You could put in a feature request if you want.

Categories : Python

Visual studio 2012 portable class library and System.ComponentModel.DataAnnotations.Schema refrence
Simply because ForeignKeyAttribute is only supported in .net 4.5 and not Portable Class Library. Check compatibility here (icons). Because Silverlight is "going" to die, this will never be supported. There were many addition in .net 4.5 and for System.ComponentModel.DataAnnotations namespace, there are also unsupported new attributes in PCL.

Categories : C#

How to move windows forms from Visual Studio 2010 to Visual Studio 2012
You should be able to just copy the Form files (TheForm.cs and TheForm.designer.cs) to the new project, then add them to the project. Note that you will also need to move any files that form depends upon (if any) before it will work properly.

Categories : Forms

How can I perform system or integration tests using visual studio 2012 without including them in run all tests?
Not that I'm aware of. What you could do is create a separate project for your integration tests and then in the test explorer, separate your tests by class. Or some other logical seperation. the current implementation that exists seems to specifically have unit testing mainly in mind, but that should change with 2013 and a stronger push towards TDD and Agile development. Have a look here :http://msdn.microsoft.com/en-us/library/ms243147(v=vs.80).aspx Scroll down to "Attributes for Identifying and Sorting Tests". There might be something there that's useful that you can use.

Categories : Unit Testing

will visual studio 2012 projects open in visual studio 2010
Depends on what features you have in your 2012 projects. Some of the 2012 features will not open in 2010 and will therefore need upgrading. To quote Microsoft: "If you use both Visual Studio 2012 and Visual Studio 2010 SP1, you can create and modify projects and files in either version as long as you don't add features that require Visual Studio 2012." More details on the features that are not supported in 2010 can be found here.

Categories : Dotnet

Deploying Windowsform application with SqlServer 2012 Databse in Visual Studio 2012
If you nose around on the MS SQL Server site, you find that you can include a 'silent installer' for SQL Server in your .NET project. This will download and install an instance of SQL Server Express as part of your installation process. Just having the .MDF in a folder is useless. In effect, you have to make at least a few items of functionality that stand in for SSMS: in particular database backups, database compaction, DBCC CHECKDB, etc. You are installing a 'full blown' SQL server instance, with it's separate windows service and system account, so you should be aware of how that impacts your user machine. This gets interesting if it's being deployed to a laptop, particularly a laptop that might sit in a café exposing ports to public LANs. In general this is a can of worms. It is

Categories : C#

Unable to connect to local database in Visual Studio 2012 express For Web: (error 26)(C#)(SQL Server 2012)
You're getting that error because the (localDB)v11.0 is already a user instance of SQL Server. When you were using the SQLEXPRESS SQL Server instance, well, it's not. So, just get rid of the User Instance=true on the connection string.

Categories : C#

Change where VS 2012 keeps the Visual Studio 2012 folder?
Click Tools>Options then Projects and Solutions change your Projects location path. There is a separate setting for project templates and item templates on the same screen.

Categories : Visual Studio 2012

Python Thread.start() throws weird exception relating to datetime.datetime
Your code doesn't show where timeout is coming from. It's not "suddenly becoming" anything. Whatever your code, at some point previously, a datetime.datetime was assigned to timeout. Either eliminate that condition, or handle it appropriately (perhaps by catching the exception). Update: You're modifying standard library code, which is an awful idea. Directly or indirectly, you're passing in a datetime.datetime. Use pdb to figure out where. Run your code in the python console. When you trigger the exception do import pdb; pdb.pm(), and you'll drop into the debugger at the site of the exception. You can explore from there.

Categories : Python

retrieve rows via join and datetime query where datetime is in past AND NOT in future
I think you need to have a group function. SELECT DISTINCT `users`.id FROM `users` LEFT OUTER JOIN `events` ON events.user_id = users.id LEFT OUTER JOIN `purchases` ON `purchases`.id = `events`.purchase_id WHERE events.starts_on <= '2013-07-15' or events.starts_on >= '2013-08-12' group by `users`.id having min(starts_on) <= '2013-07-15' and max(starts_on) < '2013-08-12' LIMIT 0, 30;

Categories : Mysql

CASTing a datetime to string if null value - keeping original datetime formatting
Replace cast with convert and appropriate style: Convert syntax & styles, eg: ISNULL(convert(varchar(20), fd.decision_date, 120), 'PENDING') as facility,

Categories : SQL

populating datetime value from php into Jquery Moble text input datetime-local
$(document).ready(function() { $("#datetime-1").val(<?php YOUR CODE ?>); $("#datetime-2").val(<?php YOUR CODE ?>); }); Its a bit hacky but it should work, just make sure the format of the date is what jq mobile is expecting.

Categories : PHP

Not valid datetime error due to wrong fomat of datetime in calender extender
Some Code to catch something like this and don't cause an Exeption: if (DateTime.TryParse(txtDate.Text, out dateValue)) { dr["Date"] = dateValue; } else { Debug.Write("TextBox Value '{0}' isn't a valid datetime.", txtDate.Text); }

Categories : C#

Why Nullable<​DateTime> can be assigned to a paramter which only can be implict converted from DateTime?
Good question. What you dexcribe is this: class MyClass { public static implicit operator MyClass(DateTime date) { return new MyClass (); } } That's an implicit user-defined conversion from a non-nullable value type (here DateTime) to the class type, a reference type. Then a conversion DateTime→MyClass "induces" a conversion DateTime?→MyClass as it seems. With the above example, this compiles: DateTime? nullableDateTime = XXX; MyClass myClass = nullableDateTime; // implicit conversion from nullable! I tried to read carefully the part of the C# Language Specification beginning with: User-defined implicit conversions A user-defined implicit conversion from type S to type T is processed as follows: [...] Here the source S is DateTime?, and the t

Categories : C#

implicit operator on types like DateTime without datetime-functions like ToShortDateString()
Add an extension method on AnnotationField<DateTime?> type: public static class Extensions { public static string ToShortDateString(this AnnotationField<DateTime?> item) { return item.Value.Value.ToShortDateString(); } } With that, you'll be able to call: public AnnotationField<DateTime?> Birthday { get; set; } myObject.Birthday.ToShortDateString();

Categories : C#

MVC : Binding datetime value (bootstrap datetime picker) from view to model
You need to give the input tag a name that corresponds to a property in your model, like this: <input name="DateEntered" data-format="dd/MM/yyyy HH:mm:ss PP" type="text"/>

Categories : Asp Net Mvc

Getting "TypeError: must be string, not datetime.datetime" in Jinja2 template but I'm using strftime
The problem is that utcnow() returns a datetime.datetime object, not a string. If you check the line number in the exception, it’s likely the strptime call that’s failing—it can parse a string into a date, but it can’t parse a date. Example: #!/usr/bin/env python2.7 import datetime import jinja2 def format_isodate(timestamp): """Format a ISODate time stamp for display.""" date = datetime.datetime.strptime(timestamp, "%Y-%m-%d %H:%M:%S.%f") return date.strftime('%Y-%m-%d @ %H:%M:%S') e = jinja2.Environment() e.filters['isodateformat'] = format_isodate t = e.from_string('{{ change.submit_date|isodateformat }}') print t.render(change={'submit_date': "2013-07-04 20:06:05.088000"}) print t.render(change={'submit_date': datetime.datetime.now()}) The first print of a

Categories : Python

Facebook OpenGraph DateTime attribute with only date being parsed as DateTime
Can I force Facebook to parse it as a date? That’s what its seems to be doing right now, but it does not seem to be what you want. I think what Facebook docs call the Precise-time format might be what you should rather use: Precise-time (e.g., '2012-07-04T19:00:00-0700'): events that start at a particular point in time, in a specific offset from UTC. This is the way new Facebook events keep track of time, and allows users to view events in different timezones. Which formats you can use to specify the OG DateTime type you can see here, https://developers.facebook.com/docs/opengraph/property-types/#simple

Categories : Facebook

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#

How to install Visual Basic in Visual Studio ultimate 2012?
Run the installer again or go to Control Panel > Programs > Programs and Features, find Visual Studio 2012, press Change and select Visual Basic from the install options when prompted. Edit: It should ask you on first run which language you want as your default. To reset this you'll need to: Open Visual Studio Go to Tools > Import and Export Settings from the menus, Select the option to reset all settings, press Next, Select Visual Basic Development Settings when prompted to select a default collection of settings. This will set Visual Basic to your default language.

Categories : Visual Studio 2012

Visual Studio 2012 "Visual C# class" template location
I'm not entirely sure if this is the same with VS 2012, but I think you can tell VS to regenerate the cache using the command devenv /installvstemplates (provided you run the command as administrator). More complete explanation (for VS 2010) here: http://ericsowell.com/blog/2007/5/22/how-to-edit-visual-studio-templates

Categories : C#

Can you convert Visual Studio 7.10 project to Visual Studios 2012?
Converting from an older version may cause problems, here and here you can find more about converting from an older version. You can also try to make rebuild the code manually, you can rewrite the project in a newer version by yourself and this will also help you understand the code.

Categories : C++

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

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

jQuery datetime to_string (iOS html5 datetime picker)
Finally got it working! This is how i did it: http://jsfiddle.net/h4tFz/ Date.prototype.format = function(format) //author: meizz { var o = { "M+" : this.getMonth()+1, //month "d+" : this.getDate(), //day "h+" : this.getHours(), //hour "m+" : this.getMinutes(), //minute "s+" : this.getSeconds(), //second "q+" : Math.floor((this.getMonth()+3)/3), //quarter "S" : this.getMilliseconds() //millisecond } if(/(y+)/.test(format)) format=format.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length)); for(var k in o)if(new RegExp("("+ k +")").test(format)) format = format.replace(RegExp.$1, RegExp.$1.length==1 ? o[k] : ("00"+ o[k]).substr((""+ o[k])

Categories : Javascript

Rails Postgres - Datetime value won't save into Datetime column
Try putting these in the create method: logger.error params[:special_deal].class logger.error params[:special_deal].to_datetime or use the debugger to investigate them. It seems that it doesn't get converted properly to datetime. You will get a clear hint after this.

Categories : Ruby On Rails

String was not recognized as a valid DateTime when converting to DateTime
The problem you are having most likely links to formatting issues. Since DateTime has a lot of different ways it can be formatted, the Convert.ToDateTime( ... ) is probably using a format that is different from your hourminute format. Try using DateTime.Parse DateTime.TryParse DateTime.ParseExact See: Convert.ToDateTime DateTime.Parse DateTime.ParseExact .NET DateTime.Parse Parse string to DateTime in C# See Custom Date and Time Format Strings for formatting strings

Categories : C#

Query in sql server 2012 with datetime between takes too long with millisecond difference
Please try this query - SELECT * FROM Table1 cg JOIN table2 mv ON cg.mv_id = mv.mv_id FULL JOIN table3 fu ON cg.fu_id = fu.fu_id FULL JOIN table4 cl ON cg.cl_id = cl.cl_id JOIN table5 so ON mv.so_id = so.so_id WHERE mv.su_id = 1 AND CAST(mv.mv_fecha AS DATETIME2) BETWEEN '20130902 17:46:03.572' AND '20130904 23:59:59.999')

Categories : Sql Server

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

displaying & editing datetime / datetime-tz in ember
datetime-tz is not a valid input type. http://www.w3.org/TR/html-markup/input.html The way that datetime-local is styled is not part of the spec and is left up to the browser. You might want to use something like the jQueryUI datepicker to ensure that things work the same across browsers. In that case you could extend the Ember.TextField view to handle setting up and tearing down the datepicker widget. App.DatePicker = Ember.TextField.extend({ didInsertElement : function(){ this.$().datepicker(); }, willDestroyElement : function(){ this.$().datepicker('destroy'); } }); {{view App.DatePicker valueBinding="date"}} Here's a JSBin : http://jsbin.com/ucanam/1054/edit

Categories : Ember Js

Comparing C# datetime value to SQL Server Compact 4 datetime
You should format the date to yyyyMMdd hh:mm:ss. lastDeliveryDate.toString("yyyyMMdd hh:mm:ss"). In this postare more details. How to compare sqlite TIMESTAMP values

Categories : C#

convert from datetime to another locale datetime in java
if both have correct time and time zone, Date in milliseconds will be same for both server and client, no matter in what time zone they are . Send the date from client in milliseconds and accept it on serverside in a java.sql.Date(long) constructor. You mentioned javascript in tags. So Date can be sent through javascript using new Date(); and can be accepted by server using new java.sql.Date(client_date); In milliseconds, the client time would be converted to appropriate server time. If client time is not properly set, for that, you can use the time difference in milliseconds like - long time_difference= new Date()-new Date(client_date); long server_time_of_execution=new Date(Client_date_to_execute).getTime()+time_difference;

Categories : Java

How to convert .NET DateTime.Ticks value into DateTime in SQL Query?
See this answer: Declare @TickValue bigint Declare @Days float Set @TickValue = 634024345696365272 Select @Days = @TickValue * POWER(10.00000000000,-7) / 60 / 60 / 24 Select DATEADD(d, Cast(@Days As int), Cast('0001-01-01' As DATE)) + Cast( (@Days - FLOOR(@Days)) As DateTime)

Categories : SQL



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