|
ok...Thanks. Is there a way that I can tell?
Steve
Not all who wander are lost...
|
|
|
|
|
Steve Severance wrote:
ok...Thanks. Is there a way that I can tell?
Yes, not sure if you have tried this, but when you load up SQL Server Enterprise Manager you can run stored procedures from within the Query Analyser tool. Keep in mind that your stored procedure may return results, it may even return multiple results, however the ExecuteScalar() method will only extract the first column which could be null in your case. You may wish to consider using the ExecuteReader() method or changing your stored procedure to check for null values.
Nick Parker
|
|
|
|
|
What I am needing for my current project is to allow the user to update a collection of objects from a component.
When you add a toolbar to your form, you can then click on the Buttons: (Collection) and the ToolBarButton Collection Editor then appears.
Now I want to do the same thing to my component. I want a RectTrackers: (Collection) property to appear!
I've tried the obvious stuff like
private RectTrackers pRectTrackerCollection = new RectTrackers( );
[Description( "List of all available Rectangle Trackers" )]
public RectTrackers RectTrackerProp
{
get{ return this.pRectTrackerCollection; }
set{ this.pRectTrackerCollection = value; }
}
and it 'seems' to begin to work. The RectTrackers (Collection) property exists, but when I click on it, it is a Object Collection Editor that does not show my internal properties.
Anyone done a custom collection property yet?
Thanks!!
|
|
|
|
|
Well, I found a Microsoft example of them at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/custcodegen.asp?frame=true
Trying to figure out the code now... Wish me luck.
|
|
|
|
|
What is the easiest way to overcome the following problem?
Controls created on one thread cannot be parented to a control on a different thread.
I have (rather had, struggle to figure it out again a very complicated way using a public delegate on the parent form and calling it in a very "strange" way when the event was fired.
Thanx all for replying
READ MSDN
|
|
|
|
|
Why do you want to do that? I never ever undertood the need to have two separate GUI threads in an app?
|
|
|
|
|
thx
An event is fired from a threaded TCP connection. EG in my case, i receive a joined event from the network thread. The executed method for the event is executed on the network thread and not on the GUI thread, hence the error.
READ MSDN
|
|
|
|
|
|
It's System.Windows.Forms
|
|
|
|
|
|
Don't feel embarrassed, it was changed from beta to release.
|
|
|
|
|
here's another one,
BorderStyle =FormBorderStyle.FixedDialog;
to set the border style, and it says it is a class where a vairable is expected
[sry for the n00be Q's, but im a n00be to c#]
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
Nnamdi Onyeyiri wrote:
BorderStyle =FormBorderStyle.FixedDialog;
like:
form.FormBorderStyle = FormBorderStyle.FixedDialog; or this.FormBorderStyle = FormBorderStyle.FixedDialog; if you are calling from the form. Note the object reference (form or this )
Are you sure you are not using an old version of SharpDevelop (latest available on sourceforge.net , latest ver 0.88b??? ) or the .NET Framework.
READ MSDN
|
|
|
|
|
iam sing the latest version, its just that i was using an add-in for vs6 that turns your dialog resource into c# code [co0l aint it] it does not have support for all controls but that can be added fairly easy [so its stated]. I found this article on CodeGuru [newin].
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
How can I change setting in IIS programmitically.For example change read/write permission of web applications in IIS.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Same thing again: System.DirectoryServices with the IIS provider. MSDN has the documentation under IIS programmers guide.
This sample will dump out the entire structure of the metabase:
using System.DirectoryServices;
...
void testIIS() {
DirectoryEntry oDE = new DirectoryEntry("IIS://localhost/W3SVC");
Console.WriteLine("[{1}] {0}", oDE.Path, oDE.SchemaClassName);
recurseObj(oDE.Children, 1);
oDE.Dispose();
}
void recurseObj(DirectoryEntries parent, int level) {
if (parent==null) return;
foreach (DirectoryEntry oDE in parent) {
Console.Write(new String(' ', level * 2));
Console.WriteLine("[{1}] {0}", oDE.Path, oDE.SchemaClassName);
recurseObj(oDE.Children, level + 1);
oDE.Dispose();
}
}
|
|
|
|
|
Thank you for your help.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
I am trying to list all the local users, groups, domains etc attached to the
local machine.
I haven't been able to find anything in the .net docs. I am not sure if there
is no support for it due to the .net environment being a standalone run time.
Thus having to call the win32 api directly in order to accomplish this task.
I was reading into the WMI without any joy.
Any thoughts.
|
|
|
|
|
Use System.DirectoryServices with the WinNT provider. It's pretty much the same as using ADSI.
|
|
|
|
|
|
Hi all,
ComboBox.SelectedValue dont seem to work correctly. Code:
...
void SetupCustomers(){
cbCust.DataSource = dbase.GetCustomers();
cbCust.DisplayMember = "Name";
cbCust.ValueMember = "ID";
}
...
However when calling cbCust.SelectedValue returns the wrong value. Calling ((Customer)cbCust.SelectedItem).ID gives the correct answer.
This seems to be a problem with the DisplayMember being (automatically) sorted as all the returned SelectedValue's are within range.
EG : Customers[] expanded may look like this:
ID(Value) Name(Display)
20 Ben
21 John
23 Ann
26 Frank
27 Arnold
The combobox will display the Displaymembers in alphebetical order. Here is where the problem lies (i think ):
Value Display
20 Ann
21 Arnold
23 Ben
26 Frank
27 John
Now this is how Mr. ComboBox display and intepret Value and Display members, thus getting the mappings all wrong.
If anyone has had a similar experience or can spot where I made a mistake, please tell me
Thanking all replies in advance
Cheers
READ MSDN
|
|
|
|
|
I don't suppose you're setting the Sort property on the combobox? If not maybe an explicit set to false would do the trick
|
|
|
|
|
Thanx Chris, however...
1. no the Sort property is not set.
2. but Sorting is really needed.
Like i said a quick work around does the trick, but i have searched forums and articles with nothing pointing to what i experience.
READ MSDN
|
|
|
|
|
I was able to reproduce the behavior doing to following:
I made a class: test with properties Name and Id.
Set the ComboBox's DataSource to a test[] With Name as DisplayMember and Id as ValueMember
Set Sorted=true
Noting that I had to set sort before setting the DataSource property otherwise it will throw an exception.
In thinking about it the behavior makes sense that it could happen this way. When you set the DataSource of a ComboBox it copies the list to its own internal list.
Text returns the item in the internal list. SelectedValue uses a combiniation of CurrenctManager ,SelectedIndex and ValueMember to retrieve an Item from the datasource. SelectedItem is probably a pointer stored in the internal list that gets Sorted with Text.
Anyways Sorting your DataSource (via Array.Sort, ArrayList.Sort, DataTable.DefaultView.Sort; whatever the type of DataSource you have) should fix the problem. Even if the
Sorted property inadvertantly gets set on the combobox, there's no mismatch between your datasource and its internal list because its already sorted.
|
|
|
|
|
thx, i wrote the original UI code a while back so i'll check if i maybe did set it to sort.
my workaround is sufficient for now though
READ MSDN
|
|
|
|