|
never used Environment.NewLine
what i want to achieve is to space the columns in the text files so that it looks like a datatable, this is to make it easy for a person to see where exactly a discrepancy between the two databases is. and report the correct changes to dbadmin
|
|
|
|
|
hi all,
i want to do a login form using workflow in c#,
please help me to design WF at this form....
thanks alot
|
|
|
|
|
There is a workflow forum on codeproject called WPF/WCF/WF. But you need to be more specific if you want help. You can also try the workflow forum at MSDN Forums. Most people at CP seem focused on WPF or WCF.
Kevin
|
|
|
|
|
hi kevin,
are u can give me a small project about it??
thank u...........
|
|
|
|
|
Your best bet is to find the Microsoft Windows Workflow samples on the MSDN site and try and work through one or two of them. Then when you get stuck ask specific questions. It's the only way to learn.
Have a look at the Cutting Edge example here:
http://msdn.microsoft.com/en-us/netframework/aa663322.aspx[^]
The book, Pro WF by Brice Bukovics is very good. However, there may be a new version out soon if it's not already.
Also the MSDN Screencasts on Windows Workflow are quite good.
I'm not using WF at the moment but I did play with it a bit about a year ago.
Kevin
|
|
|
|
|
Hi everybody,
consider the following:
I have a full report that includes a common header/footer and a number of subreports. The subreports can be enabled or disabled with parameters and all show different data sets. Now I want to display the subreport title (or a parameter or textbox value, for that matter) in the parent report header (since subreport headers are not rendered). I couldn't get this to work.
I tried different approaches, including a headline on the subreport set to RepeatWith the table, but it is not repeated. What can I do? It's ok if I have to completely restructure the report. I just don't know how.
Thanks in Advance,
OregonGhost
|
|
|
|
|
I have a class in my windows application named "Category". I have a web service which will be used by the windows application to fill the categories. Inside web service, I have another class say "OnlineCategory", of course this one is serializable. GetCategory() method in the web service returns a "OnlineCategory" instance to the caller (windows application).
I am using this "OnlineCategory" instance and creating a new "Category" instance and binding my controls. But I am looking for a better approach for this. I have the following thoughts
Both "OnlineCategory" and "Category" implements a interface say "ICategory", and all my controls should use "ICategory" for binding. So I can directly bind "OnlineCategory" instance which web service method returns.
Is this a better approach or any other methods available to do this ?
|
|
|
|
|
Hi gurus,
I'd like to know how can I get the decimal separator of the current host?
How can I know if the decimal separator is a point or a coma?
Thanks in advance.
Fred.
There is no spoon.
|
|
|
|
|
System.Globalization.CultureInfo ci = System.Threading.Thread.CurrentThread.CurrentCulture;
string decimalSeparator = ci.NumberFormat.CurrencyDecimalSeparator;
Dave
|
|
|
|
|
There's also ...CurrentCulture.NumberFormat.NumberDecimalSeparator
Dave
|
|
|
|
|
If we have a value type, we can force it to be passed by reference using the ref keyword.
Is it possible to do the inverse - pass a reference type by value?
At the moment my class creates a sort of shadow of itself as a struct and passes the struct to acheive this, but I'm sure there's a better way. I looked at cloning but the shallow/deep issues seemed to be more trouble than they were worth!
Dave
|
|
|
|
|
It's easy to get confused by this.
If you try to forcable pass a value type by reference, what is happening behind the scences is the value type is being stuck in a reference type box (refereed to as being 'boxed') and it is a reference to this box that is passed.
With a reference type what you have is actually a pointer (or reference) to the object that is stored in the heap. By default you pass that pointer _by value_. You are already passing a pointer to a reference type by value.
(If you add the ref keyword, you will be then passing a pointer to a reference type by reference. Therefore you end up passing a reference to a reference.)
It isn't possible to pass a reference type by value because the object only exists on the heap. If you create a struct the struct will only contain a pointer to the reference type on the heap, so passing the struct by value will still provide the same pointer to the same object on the heap.
The only way to really achive this effect is to do some form of deep copy the object and pass that instead.
Why do you want to pass a reference type by value?
Simon
|
|
|
|
|
Simon Stevens wrote: If you try to forcable pass a value type by reference, what is happening behind the scences is the value type is being stuck in a reference type box (refereed to as being 'boxed') and it is a reference to this box that is passed.
No, passing a value type by reference doesn't use boxing. If it would, the method would change the boxed copy instead of the original.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Good point, my mistake. it passes a pointer to the original value type (which I'm assuming is on the in the stack frame of the original method).
Simon
|
|
|
|
|
Yes, if the variable is a local variable in a method, it's in the stack frame.
If it's a member variable in an object, it has to send a reference instead. Or perhaps fix the object to keep the GC from moving it, so that it can send a pointer to the member.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks Simon.
Simon Stevens wrote: Why do you want to pass a reference type by value?
I pass an object that's part of a collection. The object needs to be editable, but not updated in the collection until later depending on certain criteria (sometimes much later after several significant changes have been made at different points).
As I said, I've found a workaround, but wondered if there was an easier/better way.
Dave
|
|
|
|
|
It sounds like your talking about some kind of transactionalised editing.
I.e, you pass the collection of objects to a form, allow the user to edit and make changes, but if they click cancel you want to roll back the changes, but if they click ok, you commit the changes to the objects.
Several options.
1) Just make the changes on the objects immediatly, but if the criteria occurs that requires a cancel, reload the objects from their original source (i.e. the database)
2) Take a copy of the objects, make the changes on the copies, only commit the changes to the main objects when the criteria occurs that requires a commit. (Sounds pretty much like what you are doing already with the structs)
3) Take a copy, make the changes on the original, restore the originals from the copies if a rollback is required.
4) Record all changes to the object, if a rollback is required, reverse the changes one by one.(kind of like an undo button)
Simon
|
|
|
|
|
Why would you want to do that?
|
|
|
|
|
|
|
DaveyM69 wrote: I looked at cloning but the shallow/deep issues seemed to be more trouble than they were worth!
Use BinaryFormatter class and serialize the object to a MemoryStream instance. Create a new object and deserialize the MemoryStream and return. But this method is slow. BTW, why do you want to pass reference types as value ?
|
|
|
|
|
N a v a n e e t h wrote: BTW, why do you want to pass reference types as value ?
here[^]
Dave
|
|
|
|
|
DaveyM69 wrote: pass a reference type by value
All references are passed by value.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Dave
|
|
|
|
|
CPallini wrote: All references are passed by value. [Big Grin]
Naturally. A reference is a value type.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|