WebMasterSam's Q&A profile
.NET Development How to code an NT Service (in C#) so it can be run from the command line as well?
HI, I'd like to create an NT service that I can also run from a command line. I am using .NET 2.0. I tried the following code, but keep getting "Invalid Handle" exception on Console.Readline... The same code used to work under .NET 1.1!! Any help is much appreciated! public static void Main( string [] args) { if (args.Length > 0 && args[0].Equals( "console" )) { MyService service = new MyService (); service.OnStart(args); Console .ReadLine(); service.OnStop(); return ; } else { ServiceBase [] ServicesToRun; ServicesToRun = new ServiceBase [] { new MyService () }; ServiceBase .Run(ServicesToRun); } } I guess he wants an exe wh ...Show All
Visual C++ 64-bit Portability issue
conversion from 'INT_PTR' to 'BOOL', possible loss of data.....what is the best way to resolve this ...Show All
Smart Device Development Xml validation
I greetings to all, threre is an effective way to validate XML in CF I tried to validate it using XmlReaderSettings but it is not effective. So someone knows how to validate an XML Greetings. If you mean validation against schema, validating XML reader is available on NETCF V2 and it works the same way as on desktop. There's no way to validate XML on NETCF V1 unless you do it all yourself. ...Show All
.NET Development active directory exeption :"Exception has been thrown by the target of an invocation."
hi i see in any active directory code the use of invoke methoe such as below: DirectoryEntry de = new DirectoryEntry ( "LDAP://192.168.0.1/cn=Users,dc=soheila,dc=org" ); DirectoryEntry de1 = de.Children.Add( "cn=newUser1" , "user" ); de1.Invoke( "SetPassword" , new object [] { "newUser1" }); de1.Invoke( "ChangePassword" , "newUser1" , "newUser2" ); de1.Invoke( "Put" , new object [] { "Description" , "my first entry" }); de1.CommitChanges(); DirectoryEntry de3 = de.Children.Find( "cn=group1" , "group" ); if (de3.Name != "" ) de3.Invo ...Show All
.NET Development COnnect to Sql using Web Service in VS2005
I have this web.config file and i want to add my connection string to that can i do that if so how do i access it Do i use the Web Configuration Manager or what <WebMethod()> _ Dim connect As String = new Web.Configuration.WebConfigurationManager("connstring") but i get an error doing this.....Please help me...thanks Check this one out http://www.extremeexperts.com/Net/FAQ/StoringConnectionString.aspx ...Show All
Visual Studio Express Editions How can I adjust my program for any resolution?
I low resolution like (600*800) I can't see all the form that I created in resolution(768*1024). So there is an option to adjust the form for any resolution and if I know the resolution of the user can I shrink the form in precent like 70% Best Regards, Yaniv Each control has a Anchor and Doc property. These can be used to automatically adjust the height and widths of controls for different resolutions. 2005 also has a FlowLayoutPanel and TableLayoutPanel that can also help. ...Show All
Visual Studio Team System Please Help With Setting Up VS2005 Team Edition for Software Developers
So, I can assume that I am missing something. I have VS 2005 Team Edition for Software Developers, but I don't know how to set it up to where I can actually create a Team Project. Is there a how-to manual on just setting it up to where developers can share a project and check-in/check-out Do I need to set up something else in addition to just installing VS2005 Team Edition for Software Developers Thanks. You need to install the Team Foundation client a.k.a Team Explorer. See the chapter "Overview of Installing Team Explorer" in Visual Studio 2005 Team Foundation Installation Guide . Note: On computers with security update 896358 installed, downloaded Compiled Help Module (CHM) ...Show All
Visual Studio Express Editions Seems simple enough shareing out a remote directory in visual basic code.
But of course it doesn't appear anyone has done is sucessfully outside of using WMI. The current code i have makes calls to the netapi32.dll that really wants to work but stumbles on the VarPtr of which it appears their is no one size fits all solution to replace this function in VB.net. Very Frustrating at this point any help would be appreciated. Essentailly what i am trying to do is create user shares remotely and assign permissons to the remote share(which i have working beutifully thanks to some VB.Net code i snagged someplace) on a Netapp. if this were a windows server it would do it automatically of course. Any help wpuld be appreciated. I had thought about shelling out and using net use but i would ...Show All
Visual Basic HScroll
In switching from VB6 to VB2005, the Scroll bars have apparently changed. The Scroll part works, so I can change a program parameter based on the position of the cursor of the Scrollbar (or using Mouse clicks). I then want to apply the new value, but only at the end of the Scrolling. There is no "MouseUp" available for the HScroll. The "Mouse hover" does work, but it causes unwanted events. Is there a way (after dragging the cursor) to apply the final value - after releasing the cursor I can do it by pressing another button, but that is too late for some cases. Also, is there a way to change the backcolor and forecolor of Scollbars Then the scroll event should be able to take care of that for you... Private ...Show All
SQL Server Sql Query with serial number
i want to display the query result with serial number for the rows ie. 1 -------- 2---------- could any one plz help me The following query is common for any database.. select Main.ColumnNames, Count(Sub.UniqueColumnName) as Row_Number From TableName Main Inner Join TableName Sub On Main.UniqueColumnName >= Sub.UniqueColumnName Group By Main.ColumnNames But it may hit your report performance... ...Show All
Software Development for Windows Vista Urgent: Scheduling service in Sharepoint workflows
Hi, Hosting a workflow in sharepoint yields in major scheduling service issue. The manual scheduler service can't be controled and thus the delay activity in turn isn't feasible. A possible walkaround was to create a task with a duedate. A windows service will run on timely basis and checks all the tasks with expiry date and updates them. In theory, updating a task will cause the workflow to trigger the OnTaskChanged method, but in practise, this wasn't the result. When this task is updated, the workflow isn't affected, whereas when manually updating the task an error occurs "event isn't received". The reason is due to the fact that the updated workflow in the windows service doesn't run the scheduler and as aresult, the workf ...Show All
Visual Basic Opening csv files through web
Hi, I'm using the following code to open a csv (comma separated values) file over the web. The problem is, when Excel opens the file, it puts each line in the first cell of each row, completely ignoring the commas. I tried using other content types, but they all do the same thing. Any help would be great. Thanks. <% Response.buffer = TRUE Response.ContentType = "application/x-msexcel" Dim vntStream Set oMyObject = Server.CreateObject("MyObject.BinRead") vntStream = oMyObject.readBinFile("c:\temp\tempcsv.csv") Response.BinaryWrite(vntStream) Set oMyObject = Nothing Response.End %> Function readBinFile(ByVal bfilename As String) Set oFSO = CreateObject("Scripting.FileSystemObject") ...Show All
Software Development for Windows Vista Using VB6 on Vista
Is VB6 support on Vista as a development language I have a VB6 application (which is pretty big), but when I come to compile it on Vista RC2 is fails to register all the activeX dlls that are build as part of the application. I did manage to get round it, but only by running VB6 as Administrator. In a day to day dev environment I don't want to do this every time. I am a local admin so why doesn't this allow VB to register my dlls. Does this behavior have something to do with UAC Thanks for your help Graham Hi. Yes, I've tried that. However when I run the IDE with that checkmark checked, none of the OCX's are found to be registered. The only way I can actually get the IDE to start nor ...Show All
Visual C++ Compiler Warning ""At least one of the arguments for ... can not be marshaled"
Hi, I keep getting compilier warnings like this: Warning 12 At least one of the arguments for 'COWSplineCalc.CalcSpline' cannot be marshaled by the runtime marshaler. Such arguments will therefore be passed as a pointer and may require unsafe code to manipulate. The warnings started after I moved the project to VS2005 running under Vista. I've found no documentation on the warning. Can I suppress it somehow Any input would be appreciated. Thanks. Mikhail The problem is that that warning doesn't have a number... I can not suppress it using pragma. Of course I can suppress all warnings, but it's a bad-bad idea. (sorry, in my message "12" was just the count number (I also ...Show All
.NET Development DbConnectionScope... HELP!
Hi! I've been trying to use the DbConnectionScope class provided by Alazel Acheson [http://blogs.msdn.com/dataaccess/archive/2006/02/14/532026.aspx] in .NET 1.1, but I'm having some problems.. To the class works in 1.1, I've had to change the Dictionary objects by Hashtables and change DbConnection objects by IDbConnection ones.. Ok, it's work great at compile-time, but at run-time, the DbConnectionScope.Current has <undefined value>.. I cannot test it on 2.0 'cause I don't have it! My question is: Is changing the Dictionaries by Hashtables my problem This is the structure of my application: Web Project Base/DAL Class Library Business Class Library In Business CL, I have methods that call DAL methods.. Example: void SomeMethod() { E ...Show All
