|
opps..
i don't really know the term used but.
for example, i have a form that has a couple of controls then when the users click say "Search DataBase", another form will show the status and then finally transit to a Datagrid that shows the database information.
Must i create 3 seperate forms for them and if yes, how do i transit from form to form?
thanks
|
|
|
|
|
Ah... this is quite a different sort of question than what the original poster asked about.
There's no hard and fast answer, it comes down to style more than anything. That said, I would not use multiple forms for the sort of thing you are describing. Consider instead one form, with actions (like Search Database) chosen from a menu, toolbar or task pane; the status as the search is performed displayed across the status bar and the result grid in the client area all along. All one form, no switching.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I have a question about enumeration types. I'd like to know if there is a way to iterate through all the literal values? I know if you have:
<br />
enum enumtype {field1, field2, field3};<br />
You can get the symbolic names from the enum using:
<br />
enumtype.field1.ToString();<br />
And I'd like to be able to go through all the posible symbolic names in my enum and add them to a combobox without having to know what all the symbolic names might be right now (because it'll probably change and I'm too lazy to have to change it multiple times!). But enum's don't seem to support and kind of a count property or have anyway of getting the symbolic name when all you know is the underlying int value.
Does anybody know if such a thing is possible with an enum, or should I probably define an array of structs or something similar?
Cheers
|
|
|
|
|
Add them to a combobox like this:
combo.Items.AddRange(Enum.GetNames(typeof(enum_typename)));
Find out the value from the selected name:
int itemIndex = combo.SelectedIndex;
string name = combo.Items[itemIndex].ToString();
datatype Value = (enum_typename)Enum.Parse(typeof(enum_typename), name);
Get a name from a value:
string name=Enum.GetName(typeof(enum_typename),value_variable);
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Great! I'll give it a try.
Thanks
|
|
|
|
|
Hi, I have this problem with connection pooling... I don't understand why they say that ServicedComponent's are stateless, except "Pooled" components.
I have done pooling in the past. But for all circumstances, the only difference between "pooled" serviced component and "non-pooled" serviced component is that you can only instantiate a number of pooled components up to whatever specified as max pool size.
Member variables (or attributes) lives for as long as the instance lives - "pooled" and "non-pooled" exhibits same behavior. But, I guess with "pooled-component", you can implement cleanup in Deactivate method.
Did I miss anything?
norm
|
|
|
|
|
Yes, you missed: pooled components are reused. Suppose you have a limited resource or a resource that takes too much time to acquire (e.g., a mainframe connection - a real world problem I solved using COM+ pooled components). You can then use the same physical connection with two different clients and keep this connection alive effortlessly by using pooled components.
Since you are keeping state (in this example, the mainframe connection) between two different requests, it is ok to say that this component is not stateless.
You can do it on anything you choose - from .bat to .net - A customer
|
|
|
|
|
thanks. i think i figure that out now.
norm
|
|
|
|
|
I am writing an Visual Studio.NET add-in in C# using the Add-in Wizard.
I would like to specify the namespace according to what I believe is supposed to be the standard naming convention:
CompanyName.TechnologyName[.Feature][.Design]
Unfortunately, since the wizard automatically generates the namespace from the solution name, I'm not really sure what all I need to change manually.
I know from other work that you can simply change a single, simple namespace name by just replacing it. (say Addin1 can be changed to Addin2).
BUT, when I try change a simple namespace to this extended type, my addin does not work anymore. When I get it "work" I get errors saying that the class has not been registered.
Any ideas?
|
|
|
|
|
Within the actual code you can just replace all references of the auto namespace to the one you want. But then you also, if memory serves, right click on the Project and Solution and change the Default namespace and other namespace related fields. Also if you have an Installer project then you need to check it's various fields.
regards,
Paul Watson
Bluegrass
South Africa
Miszou wrote:
I have read the entire internet. on how boring his day was.
Crikey! ain't life grand?
|
|
|
|
|
How put an icon for a control, on IDE ?
|
|
|
|
|
|
Hello,
I'm putting together an app which has to list the files in a selected directory. I'd like to put together the tightest and most efficient solution possible.
I'd like to pull the file data from a specific folder and bind it to a repeater or datagrid form control.
Is it possible to pull multiple file types using DirInfo.GetFiles? I'm right now using wild cards combined with file extensions, but when I try using DirInfo.GetFiles("*.gif|*.jpg"), for instance, I get an error.
If this is not possible, can I bind two different file collections to a form control without having to first add them both to an arraylist or other collection, and then bind the collection to the form control?
|
|
|
|
|
A quick glance through the code says no. GetFiles ends up just tacking the search pattern on the end of the path and calling through to the native FindFirstFile/FindNextFile. They do not support anything but standard globbing. Sorry.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi!
I am designing a graphics editor in c#. I face a trouble, if i drag a complex graphics item, it will be impossible to draw it once between two movemove event. But in normal solution, movemove event processed one by one, then it will be long delay before the graphics show on the place mouse cursor on for the program will first draw it on several useless places where mouse moved before. Is there any solution in dotnet to peek the message? If a new mousemove message arrived, the program should abandon the work it is doing and redraw on new place.
I think it is the same when we move the scrollbar.
Any idea or demo?
Thanks!!
|
|
|
|
|
|
Hi,
I'm using HierarGrid Custom Control to display hierarchical grid that display parent child relations between two tables.
My project contain the main hierarGrid definition (in the main .aspx) and as child user control it shows a nested DataGrid (inside an ascx file). When i click on plus (+) template column of the main HeirarGrid the child rows are displayed in the Inside User Control that contain a Datagrid. This works without having to reload the page cause the nested template is filled at the first page load an the rest of work is done client side.
Up to now all works fine (for the showing data side).
Unfortunately the nested DataGrid User Control contain a Colum Template with a ckeckbox to select each child rows. Now, How can I recover all the selected rows of the nested DataGrid from my main aspx page(example pressing a button)? . I think that all i need is an istance of the grid object of the nested UserControl from my main aspx page (so i could loop trought all the selected checks of this grid) but at present I do not know how to do this...
Can anyone help me please?
many thanks in advance!
nedeus,
Italy
|
|
|
|
|
ops ... maybe the correct message board for this question was ASP.NET.. however any suggestion will be appreciated anyway (i use c#) ...
|
|
|
|
|
I'm developing a socket server application in C# that I plan to use primarily to provide Flash clients with "real-time" interactivity (like chat, games, etc.)
So I've seen tons of Multithreaded socket programming articles, and tons of Asynchronous socket programming articles. What about a multithreaded design with asynchronous socket programming?
As I've come to understand (correct me if I'm wrong), asynchronous sockets uses threads, managed by the system, to execute in the first place. Knowing this, would there be a sensible advantage to combine "manually" generated threads and asynchronous socket techniques? Would it mean any noticeable performance gain, provide more scaleability, or would the extra overhead actually slow it down? Would it be worth the time debugging the dang thing considering the above factors?
I've already written a multithreaded (sync) socket server in Java, which runs pretty well. On an old PII/400 w/128MB RAM it handled almost 900 concurrent connections all sending randomly timed messages before it crashed. CPU was at 32% and the reason it crashed was it ran out of RAM Mind you, the server was running as an NT Service through a C++ wrapper for Java written by Bill Giel. Overall, I was pretty pleased with those results, and the Java server is what I'm benchmarking against.
I'm just learning C# & .NET, although I'm not new to programming. I thought this would be a fun project to get cozy with .NET.
Any comments are appreciated - thanks!
oblius
http://www.oblius.com/
|
|
|
|
|
In short, no. Stick to the async model and let the threadpool manage the threads. The CLR threadpool isn't perfect; there are some obvious features it is missing, but for the type of usage you are describing it is both sufficient and performant.
Is there some unrelated reason you think you'd like to manage your threads manually?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
I haven't touched async sockets yet, actually. I am currently writing it as a threaded app where a "main" WFC thread will spawn a thread for each connected client.
The intention in the end is to wrap it up as an NT system service, so the threaded model is necessary so I don't put any blocking code into the OnStart() handler.
I guess Async sockets would accomplish the same thing, though, wouldn't they?
oblius
http://www.oblius.com/
|
|
|
|
|
Absolutely, and the result will be _much_ more scalable than the one thread per client model. Network IO-wise all your OnStart() method should contain is something like:
Socket listener = new Socket(AddressFamily.InterNetwork,
SocketType.Stream, ProtocolType.Tcp);
listener.Bind(new IPEndPoint(IPAddress.Any, favoritePort));
listener.Listen(backlogLength);
listener.BeginAccept(new AsyncCallback(OnAccept), listener);
And then your actual IO is in OnAccept, OnReceive, OnSend, etc methods.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Cool - thanks for the information. I'll have to give that a try too.
I'm going to do it both ways, just for teaching-myself-C# sake --- but this sounds pretty interesting!
oblius
http://www.oblius.com/
|
|
|
|
|
Hi, just trying to send a bunch of stuff to a message queue:
MessageQueue mq = new MessageQueue(".\\MyQueue");
mq.Send("Hello World!");
The exception thrown was:
"A workgroup installation computer does not support this operation"
It's an XP on which I ran this small code snippet.
|
|
|
|
|
How can you retrieve a private/public key from a certificate in a specified store on a local machine?
And can you create certificates programmatically? Of course, that's different kind of certs than those from a root CA.
|
|
|
|