|
You mean replacing the files alone without affecting the schedule task in windows schedule task manager?
|
|
|
|
|
Just replace the .EXE file the task is going to use?? Just keep in mind the filename cannot change.
|
|
|
|
|
Greetings all - I haven't posted here in ages I am entirely new to .Net having been working in it for a week at most so please go easy and be detailed as possible
I have the following PONO:
Public Class WorkOrderEntity
Private intTrackingNumber As Integer
Private intDateReceived As Integer
Private strManufacturer As String
Public Property TrackingNumber() As Integer
Get
Return intTrackingNumber
End Get
Set(value As Integer)
intTrackingNumber = value
End Set
End Property
Public Property DateReceived() As String
Get
Return intDateReceived
End Get
Set(value As String)
intDateReceived = value
End Set
End Property
End Class
The issue I am faced with is how to store date/time as a timestamp (integer) but provide public properties which format/convert accordingly.
I suppose I could provide a an additional getter()/setter() but ideally I wonder if EF has a way of circumventing this "convention"?
Additionally - I am also curious as to whether it's possible to map properties to columns which are not labeled correctly?
Basically if I were working in a existing database (EF automatically builds my PONO with properties named after table fields) I wish to name the fields something more meaningful; some fields for example might be awkward abbreviations but in the object model I want something more English friendly?
I seem to recall being able to do this with Hibernate in java (actually it's PHP port) but never the less does EF support such a feature? Seems obvious that this would be useful in day to day development???
Any ideas?
Regards,
Alex
|
|
|
|
|
When you say "timestamp", what do you mean? If it's the SQL timestamp type[^], this has nothing to do with dates:
a data type that exposes automatically generated, unique binary numbers within a database.
The timestamp data type is just an incrementing number and does not preserve a date or a time.
You can map a property to a column with a different name using either the Column attribute[^] or the fluent API[^].
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I just found some articles that explain how to change the mapping for tables so I imagine columns are just around the corner.
When I say timestamp I mean a unix timestamp which can easily be converted to date AND/OR time - not sure what MSDN is getting at?!?
In the database I wish to store the date "10/10/2013" as 1381381200 but convert to a human friendly date within the PONO.
My entity objects are high level abstractions but I still prefer to store the time in a numeric format - how does EF solve/address this type mis-match? This is/was the impetus behind OR/M frameworks ain't it?
Regards,
Alex
|
|
|
|
|
Ah, OK - "timestamp" in SQL is something totally different.
I don't think there's any built-in way to perform this sort of conversion in the mapping layer. The simplest approach is probably to add a calculated property for the date, decorated with the NotMapped attribute:
Public Class WorkOrderEntity
Private Shared ReadOnly Epoch As New DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero)
<Column("DateReceived")> _
Public Property DateReceivedTimestamp() As Integer
<NotMapped> _
Public Property DateReceived() As DateTimeOffset
Get
Return Epoch.AddSeconds(DateReceivedTimestamp)
End Get
Set
DateReceivedTimestamp = CInt(Math.Floor((value - Epoch).TotalSeconds))
End Set
End Property
End Class
I'd be inclined to use DateTimeOffset for the property rather than a string; formatting the date should be a UI concern.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
EF will see a .NET type of DateTime in your POCO and use the native DateTime datatype specified by the underlying data provider. It will not convert a DateTime to a "serial number" as you want because the serial number can be based on any arbitrary epoch. For example, UNIX uses 1/1/1970 00:00:00AM whereas .NET uses 1/1/0001 00:00:00AM. So, to each system, the datetime serial number will mean something different.
Why even do this?? Why not just let the underlying database handle the storage and return the correct datetime without your code having to worry about conversion?
|
|
|
|
|
Hi,
Please, I really need a help.
Everytime I try to launch every Kinect application, VS 2010 indicates me that there is a problem with the Runtime in Microsoft.Research.Kinect.
Everytime, I get this :
"Impossible de charger le fichier ou l'assembly 'INuiInstanceHelper, Version=1.0.0.10, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ou une de ses dépendances. Le fichier spécifié est introuvable."
Please, can you tell me what's wrong and what I have to do.
Thank you very much.
|
|
|
|
|
It means that it cannot find the assembly named in the message, or some other assembly that INuiInstanceHelper depends on. Check that you have the correct version of .NET installed and any third party products that are needed.
|
|
|
|
|
Thank you for the answer,
Yet, I imported the "Microsoft.Research.Kinect" in the Referencies Forlder and declared it in the code behind...
Imports Microsoft.Research.Kinect.Nui
Imports Microsoft.Research.Kinect.Audio
Private nui As New Runtime
Even if I try to lauch downloaded projects containing the Microsoft.Research.Kinect Library, it does the same thing.
|
|
|
|
|
|
Thank you Richard, let me check in out then tell you...
|
|
|
|
|
Please explain how memory managment is done in .Net Framework in detail
|
|
|
|
|
Since it's already been done thousands of times all over the web, you can go read those articles instead of expecting one of us to write it up again for the 2,440,001st time.
Read these[^]
A simple Google for ".net memory management" would have told you everything you wanted to know.
|
|
|
|
|
..that might take a day
Start here[^] and read all the links that the documentation points to.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Why is not TRUE this case:
Private Sub EliminaN_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EliminaN.Click
dr = MessageBox.Show("Do you want Delete notification?", "Delete Notification", MessageBoxButtons.YesNo, New System.EventHandler(AddressOf MsgBoxRet))
End Sub
Private Sub MsgBoxRet(ByVal sender As Object, ByVal e As System.EventArgs)
If dr = DialogResult.Yes Then
Delete()
End If
End Sub
I submit button Yes, but condition not works.
I use WEB GUI form. Can you show me any type solution? Thank you
|
|
|
|
|
Junoli wrote: Why is not TRUE this case:
Ehr.. is that System.Windows.Forms.DialogResult, or does ASP.NET have it's own implementation?
Junoli wrote: Can you show me any type solution? Thank you
JavaScript, alert[^].
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hello guys. Working in C# when you collapse a function, only the functions signature remains visible while the rest of the function body changes into boxed ellipsis. The color of this ellipsis also changes accoring to the settings. Again, the color of the boxed ellipsis changes only. It looks something like this
int Function() ...
I want the same in VB.Net. Although the function signature remains visible but unlike CSharp, color of the whole function signature changes in VB.Net. At the very least, I don't feel comfortable with this.
I hope you got my problem. If so, is there a way to make this behavior similar to that of CSharp? Thanks for any suggestions.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
Menu: Tools -> Options -> Fonts and Colors.
|
|
|
|
|
I think my question was not clear enough. I exactly did what you suggested, before posting this question.
I also wrote that the whole function signature changes its color.
However in CSharp, only he boxed ellipsis changes its color. The function signature retains its color scheme.
So is there anyway in VB.Net, adopt this CSharp behavior in VB.Net. I googled it but could not find any.
This world is going to explode due to international politics, SOON.
|
|
|
|
|
This is nothing to do with C# or VB, it is a Visual Studio issue, and these changes can only be made through the options settings. If VS does not offer a specific option to do what you want then you need to petition Microsoft for the change.
|
|
|
|
|
There is no setting to change that behavior.
It may appear that the same code editor is being used when you look at C# and VB.NET, but it's not. The C# and VB.NET code editors were written by different teams at MS and the functionality difference between the two are quite extensive.
Part of the reason for these differences is maintaining a "feel" that appeared in previous products. The C# code editor "feels" more like the editors of C/C++ of Visual Studios past, while VB.NET "feels" and works more like the old VB6 and below editors.
|
|
|
|
|
Hi
I have used itextsharp for convert innerhtml content to PDF. but textbox and sigplus(Activex signature) controls are not converted and it displayed empty field in PDF. How to convert all controls to PDF.
Thanks in advance
modified 6-Feb-13 6:41am.
|
|
|
|
|
You cannot convert a control to show up in a PDF. You have to grab a snapshot of the displayed control (think screen shot) and put that into the document.
Considering it's HTML, I don't know how you're going to get the image of the control seeing as though it can be anywhere on the screen.
|
|
|
|
|
Hi to the community.
I am an electronics engineer by profession. I have programmed in C and C++ and therefore mostly understand about object oriented programming and classes.
However, I have downloaded a program, from "the code project", that is written in C# for the asp.net framework. It implements "The Rectangle Packing Algorithm".
I do need to rearrange parts of this program in order to suit my needs. It was written by a professional web developer. I have loaded the program in visual studio and it does run.
I have tried to make heads or tails out of the program by reading books about C# and asp.net but the process is rather slow and I do have a life. I can now "get around" in simple c# but this program is still way above me as I can't make heads or tails out of the way that the C# is making use of the asp.net framework.
I would learn a lot faster if I knew someone that was capable of looking at the program and saying "here is what is going on here and there, etc". It is not a matter of asking a simple question, say, about classes or constructors, etc.
At my company there are only C, C++ and embedded programmers who claim no knowledge of c# or asp.net.
I am even amenable to paying someone for their services, through PayPal.
Advice is welcome.
Regards
Tom
|
|
|
|