|
Thanx for the reply, but this is exactly what I dont want to do!
There mite be a 100 sub patterns. A lexical analyzer can handle this easily, but is this possible in RegEx?
<a TITLE="See my user info" href=http:
|
|
|
|
|
I have a WinForm app that is fine and dandy when executed as a simply local exe. I'd like to host it via a webserver (http://blahwebserver/MyApp/Myapp.exe). I've gotten through a few initial issues which brought to light some holes in exception handling, but I'm really running into a problem with the config file apparently not being loaded. I don't really know what to do about this or where to research on it, though I kinda hoped it would have been mentioned in here[^] but it wasn't. So I've got nothing at this point.
|
|
|
|
|
If you have ASP.NET running on the server, it might be blocking access to the .config file because of a bug in .NET 1.0.
Edit the machine.config* [edit]on the server[/edit] and change line 447 from
path="*.config"
to
path="web.config"
This will allow your app.config file to download but still block downloading of the web.config file.
[edit]*On my computer it is at: C:\WINDOWS\Microsoft.NET\Framework\v1.0.3705\CONFIG
If you have .NET 1.1 installed on the server then this change has already been made, but if you told IIS to use .NET 1.0 for that application (or for the whole server) then you still need to edit the machine.config[/edit]
James
"I despise the city and much prefer being where a traffic jam means a line-up at McDonald's"
Me when telling a friend why I wouldn't want to live with him
|
|
|
|
|
Just found out that it is not a good idea to try and load 20k+ records into the standard DataGrid (windows.forms, not the asp one), takes ages and sucks memory - not a problem on my machine, but the users...
Anyway, anyone got any ideas? I have been reading about virtual grids, sounds just what I am looking for, but have not been able to find a free/reasonably priced one.
|
|
|
|
|
Seems like 20K records in a grid would be hard to navigate to find anything. Isn't there some way you can filter that to bring the number down?
You can kind of build your own virtual grid out of the standard grid. It depends on how your data is stored.
In a program I have been working on, I wanted to be able to walk through the records one at a time regardless of the binding and control I was using. By making my own collection that provided ITypedList, I was able fetch the desired record in the indexer. Worked well with a range of databindings.
Rocky Moore <><
|
|
|
|
|
Does anyone know how I can accomplish this? I have a combo bo that I want to be active (the user can interact with it and select from the available options), but I don't want them to be able to edit the existing entries or type new values into it? Is this possible without writing my own combo box? I thought about just removing focus but then I don't think the user would be able to select from the existing items because it would never be able to get focus.
TIA,
-=- Kevin
|
|
|
|
|
Wow!! Ignore this stupid question.. I can't believe I missed that.. Sheesh.
|
|
|
|
|
myComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
RTFMSDN *joking*
Shaun
[edit: I have posted the answer anyway as I had already started before you posted your second message]
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|
|
yah, I found it pretty much right after I clicked the submit button on the question.. 10 lashes with a wet noodle shall be my punishment for asking before thoroughly looking..
Thanks!
|
|
|
|
|
its default property dont u know it
|
|
|
|
|
How would you link a combo box to a list box. I have a table of products, and a table of categories, and these are linked the standard way. My combo box has a dropdown of the categories. I want the listbox to be populated with all items that have the same category as the one selected.
Any ideas?
|
|
|
|
|
I would just attach a listener to the Combo box that calls a function that can populate the listbox with the correct items based on the selected index or item. Is this what you were looking for, or do you need some more detail?
|
|
|
|
|
A bit more detail if that would be possible.
|
|
|
|
|
ok, this is just off the top of my head but it should be close enough to get you going.
myCombo.SelectionChanged += new System.EventHandler(this.SelectionChanged);
private void SelectionChanged(object sender, System.EventArgs e) {
switch(((ComboBox)sender).SelectedIndex) {
case 1: //populate listbox for index 1
break;
case ..
}
}
This should get you going..
Good Luck,
-=- Kevin
|
|
|
|
|
In a number column in Datagrid, I want to enter a negative number by using the NumPad "-" key. It does not work at all, but if I use "-" key in number row in the main key board, it works fine. After a further research, it seems that NumbPad "-" or "+" key does not fire a key_down or key_press event,(means no way to capture these two keys). Anyone knows how to solve it?
|
|
|
|
|
other keys are all working except "-" and "+".
|
|
|
|
|
See:
protected override bool ProcessKeyPreview(ref Message m)
protected override bool ProcessDialogKey(Keys keyData)
or other methods with Key in names.
Hi,
AW
|
|
|
|
|
Hi,
Should I be able to bind to a sub-property of a DataItem in a data grid?
i.e:
<br />
<%# DataBinder.Eval(Container.DataItem, "Product.Title") %><br />
It doesn't work for me. I get this message:
<br />
Exception Details: System.Web.HttpException: DataBinder.Eval:<br />
'POM.ProductDetails' does not contain a property with the name Title.<br />
But POM.ProductDetails does contain a Title Property!
The only way I can get it to work is to use a helper i.e.:
<br />
public string GetProductTitle(object Product)<br />
{<br />
POM.ProductDetails product = (POM.ProductDetails)Product;<br />
return product.Title;<br />
}<br />
This seems to be a very long way of doing it, especially if I have to do it
for every property!
Any ideas?
|
|
|
|
|
Hey everyone,
I'm still chugging away on my little game. Right now you can connect to a server and play across the internet. The 'game' works, but I'm having some serious issues with memory leaks.
I don't know when I should implement the IDisposable interface. Even when I implement it, it doesn't seem to make any difference at all. It seems the source of my problem are arrays and their values.
For example: I had an array of bullets. Whenever one bullet was spent and no longer being used, I would just simply call: bulletArray[i] = new Bullet(); and replace the old version of the object with a new one. This caused a very unwelcome memory leak that took me hours to track down. I thought I could just overwrite the old object but it turns out the system holds on to it indefinitely.
My next problem. I've recently started using ArrayLists. Whenever something was no longer needed, I would .Remove(ObjectNoLongerNeeded). Wouldn't removing the object also set it up for garbage collection? It doesn't seem to. What do I need to do to get rid of the old object and reclaim the memory?
This is my first C# program and the first time using a OO language. It's wonderful to see my program working, but whenever anyone shoots while connected their program's memory requirement permanently increases. Whenever anyone explodes, memory requirement goes up. I know this has to do with my arrays, but damn, there are so many of them. How can I get around this?
If I have a class called MyClass() that implements IDisposable, what do I need in the Dispose function to actually 'dispose' it? How do you dispose integers, floats, and other primatives?
Thanks,
EvilDingo
|
|
|
|
|
|
Interesting problem. You only need to implement IDisposable if you have either unmanaged resources (i.e. window or other object handles from the OS) or scarce managed resources (i.e. database connections). All other managed classes, including arrays, should be collected by GC periodically.
In fact, implementing IDisposable imposes a small performance penalty when it comes to garbage collection. Not that you should never do it, but only do it when necessary.
I have heard of other situations like this. I don't know if it was a problem with the Framework or simply sloppy programming. You may look into using structures instead of classes, if your classes are very simple and contain mostly primitives. Structures can have constructors, properties and methods. They are like light-weight objects, but are created on the stack instead of the heap.
HTH
|
|
|
|
|
Hi
I know this does not answer your question, but I hope you know about the problems with ArrayLists. If you dont know these problems, these are what they are. Once you have set up an array to hold a certain number of items, it works fine. When you start increasing the size dynamically, speed drops bigtime, especially if you have large arrays or lots of them. The way it works, is if it can store 10 ints, and you add another 1, it will make a new array, and copy all the items into it, and hopefully delete the old one.
|
|
|
|
|
Hey,
I have read this before it is possible to create an instance of a type
by specifying their string literal equivalent.
for example if i need to create an instance of Employee class
generally i will say Employee objEmployee = new Employee();
my question is i just know that the class which i need to instantiate is "Employee" how will i instantiate using the string "Employee"
hope i did not made the simple ques more complex.
Cheers,
Venkatraman Kalyanam
Chennai - India
"Being Excellent is not a skill, it is an attitude"
Reality is an illusion caused by caffeine deficiency(one Microsoft Research scholor)
|
|
|
|
|
Check out AppDomain.CreateInstance and AppDomain.CreateInstanceFrom
Rocky Moore <><
|
|
|
|
|
You can instantiate a class using a "partial" name... i.e. the type name as a string literal, one way is...
<br />
string path = "MyApp.MyAssembly";
string class = "MyClass";
<br />
object MyObj = Assembly.Load(path).CreateInstance(class);<br />
This is most useful when your class implements a known interface but you want to dynamically load the implementation because you can do the following.
<br />
IFooBar fooBar = Assembly.Load(path).CreateInstance(class) as IFooBar<br />
This stuff is my favourite thing about .net...
HTH
Shaun
-----------------------------------------------------------------------
Shaun Austin: .NET Specialist. Spreading the word of .NET to the world... well the UK... well my tiny corner of it!!
|
|
|
|