|
Hi,
Anyone know why I'd get this error?
The type or namespace name 'CollectionEditor' could not be found (are you missing a using directive or an assembly reference?)
I do have using System.ComponentModel.Design; and then
private class CustomTableStylesCollectionEditor : CollectionEditor<br />
{<br />
public CustomTableStylesCollectionEditor(Type type):base(type)<br />
{<br />
} <br />
...<br />
} <br />
Thanks again!!!
Mel
|
|
|
|
|
melanieab wrote: Anyone know why I'd get this error?
The type or namespace name 'CollectionEditor' could not be found (are you missing a using directive or an assembly reference?)
You have to add a reference to System.Design.dll too.
Share and enjoy.
Sean
|
|
|
|
|
Thanks!!!!
Mel
|
|
|
|
|
Hi all,
I have a table which is having one datetime column. I try to retrieve values from the table in SP along with the mentioned datetime column value.
When i Run the query in analyser it works fine ( i expect the datetime column should return datetime with Millisecond and not with AM PM ) in query analyzer.
WHen i asssign the same values to a property in the middle tier, the millisecond values got truncated and the AM/PM comes into picture. ( i tried to have the property as string not datetime , it doesnt work ] .
Any help that how can i retrieve and assign a datetime column value with millisecond and not with AM/PM in C#.
code snippet please!
Happy coding!!
kotteeswaran
|
|
|
|
|
The problem is not where you think it is. A DateTime value does not have a format, so it can't have an AM/PM indicator. It's when you convert the value into a string that it gets it's format. If you specify a format where the milliseconds are visible, you will see that they are there.
---
b { font-weight: normal; }
|
|
|
|
|
Can you connect to an Oracle Database when the form loads without executing a query? I would like to connect to the db first when the form loads and have a static connection while the application is running. When the user clicks a button, it simply performs a query and does not have to connect.
Any suggestions?
Thank you!
Apoc
|
|
|
|
|
Yeah, don't do it.
It's considered very bad practice to grab a very expensive connection license and hang on to it when your app isn't doing anything. Connect, query, release. It's that simple. There's almost never a good reason to hold onto a connection to the database for the life of your application.
Think of it this way. If you have 100 people using your app, but only half of them are doing any database work at any one time, do you want to spend $15,000 for 100 connection licenses or $7,500 for 50?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Yea your right...
I fiqured out that the query was taking a long time and not the connection.
Thanks for the input!
Apoc
|
|
|
|
|
Hello,
I have a TextBox and a ListBox controls. I want to raise KeyDown event of the ListBox when user presses Up or Down Arrow keys from keyboard, on the TextBox.
How can I send the Keycode (key stroke) that user just pressed, to my ListBox from within KeyDown event of my TextBox?
Thanks,
Baris.
|
|
|
|
|
The best way to do this is to inherit a control from ListBox or TextBox, then call the protected method OnKeyDown. There are other ways as well, such as using SendKeys (not recommended, as it makes use of hooks, which can be blocked by certain anti-virus applications), or using the Win32 PostMessage.
I'd recommend inheriting from the control and calling OnKeyDown to artificially raise the event.
|
|
|
|
|
Aren't there any more easy way to do this?
If not, how can I inherit? Note that I want to use this new control at design-time. In other words, I must see the new control on my palette (Toolbox). And it must be like the list box exclude new method: MyKeyDown which I can call it from within any where of my code.
Thank you very much,
Baris
Notice: I am new to .Net and C#.
|
|
|
|
|
Inheriting is easy to do. Just create a class like this:
public class MyListBox : ListBox
{
...
protected override void OnKeyDown(KeyEventArgs e)
{
base.OnKeyDown(e);
}
public void FireKeyDownEvent(Keys pressedKeys)
{
OnKeyDown(new KeyEventArgs(pressedKeys);
}
}
As far as adding your control to the toolbox, you should be able to do it just by adding new item to toolbox, and when it asks you for the item, have it point to your dll containing MyListBox. I recommend you look at some of the articles here at Codeproject on how to design a good custom control fit for the toolbox.
|
|
|
|
|
badidi wrote: Aren't there any more easy way to do this?
You could also try using reflection to call the protected member on the control you want to access.
Jared Parsons
jaredp@beanseed.org
http://spaces.msn.com/members/jaredp/
|
|
|
|
|
What is reflection? Can you give an example?
Baris
|
|
|
|
|
I don't want only raising event. Also I want to make an effect to list box as if user pressed the down arrow key on it for example.
Baris
|
|
|
|
|
Hi i am having some trouble tryin to make sure the users of my web app (which im writin in c#) enter the correct types of data in the fields is ther someway to check if the data entered is a string when it should be and a number when it should be without doing a postback to the server, any ideas
Thanks in advance
|
|
|
|
|
|
Hello there,
I did Com+ component has many class all classes marked with autocomplet , Guid and some required and other requiredNew when i am trying to call methods from one of these classes it prombet me with this message
"The transaction has already been implicitly or explicitly committed or aborted
"
Please i need to know what dose it means this message.
Thanks for your time and help
Best regards,
Hoho
|
|
|
|
|
It means exactly what it says. You are trying to use a transaction that is no longer in use.
To tell you anything more than that, you have to provide some information on what you are trying to do.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your reply
I am trying to do some operations on the Sql database with this com+ like insert, update and delete but this operations works with transactions
Thanks
Hoho
|
|
|
|
|
I need to show dialog box sliding from beneath the title bar or a toolbar if there is any, in the form. I have searched in this website and saw dialogs sliding from the edges(top or bottom) of the form. How do I provide the same effect by making the dialog slide from below the title bar. How can I make the upper portion( that is yet to be shown by sliding) invisible in this case. Any ideas would be greately appreciated.
Thanks,
|
|
|
|
|
Perhaps you can try using a collapsible splitter as suggested in this article:
http://www.codeproject.com/cs/miscctrl/collapsiblesplitter.asp
|
|
|
|
|
Hai ekynox,
Thank you for the idea. I will try and see if that works for me.
VPMahank.
|
|
|
|
|
Does anybody have any telnet protocol in csharp other than what I found here. I would like to see more examples of telnet protocol.
|
|
|
|
|
I am trying to send serial data at a very high rate (18 bytes every 5 msec). I am using a multimedia timer to get the 5msec and the built in Serial port object in the .NET 2.0 framework. I am using the begin and end write calls to do asyncronous writes in order to keep up. This seems to be working, but when I look at the memory usage for my program it is gradually going up and when I run for over 5 hrs I use all of the system memory and my program crashes. Does anyone know if there are known issues with the Serial Port object or of any way to do this without causing the memory to go up? Any help with this would be great, thanks.
|
|
|
|