|
From what I've read, WPF assigns 2 threads at the start, a Render thread and a Dispatcher thread. The Render thread does the background work, while the Dispatcher thread does the work of maintain the GUI. Any explanation I give you won't be as good as this on MSDN[^]
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Does anyone have experience using this? Just wanting to get an overall feel of how people feel about this before I jump in head first and end up regretting it. Any feedback would be greatly appreciated.
|
|
|
|
|
Object Relational Mapping [^]is rough so you probably will regret it but the other options are no better.
Also look at the Castle Project's[^] Active Record which uses NHibernate
Also if .NET 3.5 is in your future I see people here on CodeProject seem to like LINQ so you might check that out, there is a forum for it LINQ and .NET 3.5
led mike
|
|
|
|
|
NHibernate have a huge userbase and is a very competent mapper.
As a mapper it is _far_ supperior to LinqToSql.
However, the tool support and nice linq support in LinqToSql is way better.
(The NH team is working on their Linq support, so it will come eventually)
So if you want some RAD with a very basic DB, then go LinqToSql.
If you have a serious system with a complex db , then use NHibernate.
Also, the mindset of using an ORM is way different from "the other ways"
When using an ORM, your Domain Model is the core of your app.
The DB is pretty much just a persistent store for your objects to sleep in when not used.
(thus "Hibernate")
The whole idea is to be able to work with objects in an object oriented language.
Which probably was the main reason you started to use an object oriented language from the start.
It also tend to be a somewhat heated debate, some will claim that working with objects is madness and not very good at all when performing business operations etc.
(some might even pull data out of their db and transform it via some (mapping info/declaration) into a new (persistent) structure and apply dirty tracking and other infrastructural features on this structure and claim that they are NOT doing ORM and that ORM is bad )
modified on Wednesday, April 9, 2008 4:07 PM
|
|
|
|
|
NHibernate is an excellent library and is very robust and flexible. We use it as the core of our data layer toolkit for these reasons. It can be a bit intimidating for a new user though.
If you decide to go with vanilla NHibernate you should fix whether you are going with 1.x or 2.x - as the new 2.0 beta has introduced quite a few breaking changes to the API - especially with queries.
|
|
|
|
|
|
Hello,
I am working on a uninstaller program. Right I'm able to get all the info from the registry on all programs installed using a console application. What I need is a sample list control that will need about 14 columns and any number of row. This way I can display to info on a windows form so that way the user can remove his/her programs.
Just need a little help picking the right component to do this.
|
|
|
|
|
I think if you use a datagrid and a custom class, you can bind directly to a list of your custom classes.
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
I am having a webservice which creates an excel file in server and sends back it as byte array.
Now i want to write that byte arry in excel file in the client side.can any body help me out.It's an winform application.
|
|
|
|
|
kurangu wrote: i want to write that byte arry in excel file in the client side.
Well if those bytes represent the bytes of the Excel file then you just write them to a file. If they are something else then we don't know what they are so we can't help you.
led mike
|
|
|
|
|
Mike,
It's an bytes of excel file.But when I write in client side.Not able to open the excel file.It says not in recognizable format is there any format getting changed by webservice.
|
|
|
|
|
kurangu wrote: is there any format getting changed by webservice.
how could I possibly know what the webservice is doing?
led mike
|
|
|
|
|
string sfilename = @"C:\\\\test.xls";
FileStream fs = new FileStream(sfilename, FileMode.Create);
xlw.Save(wb, fs);
byte[] binFile = new byte[fs.Length];
fs.Read(binFile, 0, (int)fs.Length);
fs.Close();
return binfile.
Mike the above code returns the byte(right now I am saving the excel file with test.xls in server)
after that i am getting the byte.
client coe:-
-----
byte[]test=webservice.getdata();
FileStream output = new FileStream("C:\\test2.xls", FileMode.Create,FileAccess.Write);
output.Write(test, 0, test.Length);
output.Close();
Test 2 created with the same size as test in server but when i open I am geeting format not good.with empty xls.
|
|
|
|
|
Can you open the spreadsheet thats saved on the server before its transmitted to the client?
Something smells fishy about your file saving code. You create the FileStream with FileMode.Create
Then you try to use that file stream to read. I don't think thats the correct way of reading/writing files.
Just because we can; does not mean we should.
|
|
|
|
|
I think they create a new file, then xls.Save(wb, fs); writes the actual spreadsheet to the file. After which they read the data back, which shouldn't be a problem i beleive...
My current favourite word is: Bacon!
-SK Genius
|
|
|
|
|
Open up both files in xvi32 (or another hex editor) and see if there are any obvious differences, like all the bytes are 00 for example. The most probably place for an error is right at the beggining and right at the end, so check there first.
My current favourite word is: Nipple!
-SK Genius
|
|
|
|
|
Is there any possibility to add new files to a msi installer? For Example I have created MyApp.msi ... but I want to add a different configuration file for each client. So I wonder if it is possible somehow to add or replace a file in the msi package without recreating the package. Thanks a lot.
|
|
|
|
|
Radu_20 wrote: So I wonder if it is possible somehow to add or replace a file in the msi package without recreating the package.
I would believe so based on some Windows Installer work I did back in Versions 1 and 2. Maybe this will help you find a solution.[^]
led mike
|
|
|
|
|
Hi,
I need to get the Files last Modified Date.Iam given a Zip File by our client on extracting it I get many files, say I got a File A.txt.
whose modified date is 2/19/2008 06:30:00 A.M.
Iam using
DateTime _datetime;
String str = "C:\\A.txt"
FileInfo filinf = new FileInfo(str);
_datetime = filinf.LastWriteTime;
I get the correct output in _datetime.
Now , If I change my System TimeZone from ( GMT +5:30)chennai... to (GMT -8:00)Pacific Time (US & Canada) and then again extract the Zip file to get file "A" with modified date as 2/19/2008 06:30:00 A.M
and execute the same code I get it as 2/20/2008 05:30:00 A.M.
Why is it So?There is an offset of 1 hour.
I need Files Last Modified Date(say here 2/19/2008 06:30:00 A.M only) Irrespective of TimeZones Iam In.
Any suggestions would be appreciated.
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
I think you should use Globalization For that.
User RegionInfo Class and Try to use the date time from that class.
This is just my idea !!!
Best Regards
-----------------
Abhijit Jana
Microsoft Certified Professional
"Success is Journey it's not a destination"
|
|
|
|
|
I got the solution
FileInfo filinf = new FileInfo(FileName);
_datetime = filinf.LastWriteTime;
DaylightTime dlt = TimeZone.CurrentTimeZone.GetDaylightChanges(_datetime.Year);
_datetime = _datetime.AddHours(Convert.ToDouble(dlt.Delta.Hours));
_datetime = _datetime.AddMinutes(Convert.ToDouble(dlt.Delta.Minutes));
_datetime = _datetime.AddSeconds(Convert.ToDouble(dlt.Delta.Seconds));
Thanks
Today is a gift, that's why it is called the present.
|
|
|
|
|
Hi,
you have a problem with FileInfo.LastWriteTime?
if you read the documentation, you should notice the very next item in MSDN is
FileSystemInfo.LastWriteTimeUtc
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Use LastWriteTimeUtc instead. The LastWriteTime property is adjusted for timezone and daylight savings time, while the UTC version is not.
|
|
|
|
|
Dear gurus,
finally I get totally crazy with interoperability of un/managed code.
I have the unmanged Cpp-Class "MyCppClass" with one simple member-function "add()". This class is not shown here. Now I build a managed wrapper class "MyCppClassWrapper".
I create an instance of this wrapper in a C#-Program and then I want to call the method "add()".
<code>
#include "MyCppClass.h"
namespace Managed {
public ref class MyCppClassWrapper {
MyCppClass *pInst;
public:
int add(int a, int b);
};
}
// implementation
int MyCppClassWrapper::add( int a, int b) {
return pInst->add(a,b);
}
</code>
If I the program starts, I get a FileNotFoundException: "The specified module could not be found. (Exception from HRESULT: 0x8007007E)"
But if I comment out "return pInst->add(a,b);" then everything works fine. It seems that I cannot call the function add() of the pInst-Pointer.
I'm totally lost
<div class="ForumMod">modified on Wednesday, April 9, 2008 10:05 AM</div>
|
|
|
|
|
Tomerland wrote: But if I comment out "return pInst->add(a,b);" then everything works fine.
The code you posted does not show the pInst member being initialized. You can't use it without initializing it to a valid value.
Oh and this is the wrong forum for your question. This is a C++/CLI question so if you need more information you should ask in that forum.
led mike
|
|
|
|