|
how do i make the form components to look like the XP controls?
[i bet its omethin reeeeealy simple, and im gonna feel stupid when i find out]
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
|
not that hard, all you gotta do is copy the xml they give you into a file of name <project>.exe.manifest and put it in the same directory as the prog and it runs wiv xp style.
Email: theeclypse@hotmail.com URL: http://www.onyeyiri.co.uk "All programmers are playwrights and all computers are lousy actors."
|
|
|
|
|
I have an SqlCommand AuthUser which call a sproc in a database. When I call execute scalar it produces a NullReferanceException. Code below. Thanks.
private bool CustomAuthenticate(string username,string password)
{
AuthUser.Connection = Global.sqlConnection;
AuthUser.Parameters[0].Value = username;
AuthUser.Parameters[1].Value = password;
long ret = (long)AuthUser.ExecuteScalar();//Crashes here
return (ret > 0);
}
Steve
Not all who wander are lost...
|
|
|
|
|
I'm kinda guessing that your stored procedure is returning null....
|
|
|
|
|
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.
|
|
|
|
|