ImagineNation's Q&A profile
Visual C# How to schedule windows service in c#?
Hi, I have created windows service in c#. I would like to schedule windows service manually or by coding .How can I do this. Actually, I am looking for My Service should start every day at 9’o clock in the morning and after some time My service should be stopped. As Microsoft has provided a Schedule Task in windows XP, where we can schedule any exe . In the same way how can I schedule any windows service to execute on specified time Any help is appreciated Regards, Rajesh You can use the net command: net start myservicename net stop myservicename Or, you can write your own by using the ServiceController class. ...Show All
.NET Development Async page and a class library
Hello. I have a class library that consumes a web service. It does some processing both and before after calling the web service method. One customer is requesting that I expose the async methods provided by the web service proxy so that they could take advantage of the new "Async=true" ASP.NET feature. However, I can't just expose them as they would then circumvent for the pre- and post-request processing that my class library has to do. My initial thought was to create my own async methods that would simply wrap the proxy's. Then, I thought about shielding the customer from all that and instead, calling the proxy's async methods myself in the single method that they'd call. That is, to them, my method still blocks. But i ...Show All
SQL Server How to set douplicate id in sql server 2005?
Hi There, Some one please help me to achieve this task. I have task to join 2 tables and insert values.The table which i am inserting values has typeid column which is primary key column.I supposed to insert values except this column(TypeId).When i m trying insert values its throw an error saying Error: Cannot insert the value NULL into column column does not allow nulls. INSERT fails. Please let me know ther is a way to set duplicate id for this rows Thanks in advance. Hi Phil, I have gone thru your articles i got the ideas to do. But i am facing problem while using theis scripts. i have no.of sql statements i have droped no.of execute sql tasks for each statements.Please find the below script, select ...Show All
Windows Live Developer Forums Due to a connection problem, changes you make might not be applied to other computers you use
Hi, Due to a connection problem, changes you make might not be applied to other computers you use I am getting this error in Live Messenger for last few days... As a result, my contact list is not appearing correctly and all the contacts are missing. Anyone having same issue Thanks Fahad well.. i tried to fix this problem on MSN Live 8.0, but no solution available from anyone.. searching on net also invain... so i uninstalled MSN 8... then i found MSN 7.5 on Microsoft site (rather than usual Messenger.MSN) at http://www.microsoft.com/downloads/details.aspx displaylang=en&FamilyID=0b88ccbf-4c52-4347-aa71-87184a13ac1c and installed... and all working properly ... I think i will wait another few weeks before a ...Show All
Visual Studio Team System IPolicyDefinition and IPolicyEvaluation documentation
Hi I am in the process of trying to extend the check-in policies for our Team Foundation Server. Is there anywhere that describes the IPolicyDefinition and IPolicyEvaluation interfaces I have found some samples on how to do things but it would be nice to have a better understanding of the interfaces rather than guessing how to use them. Cheers Brett See http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=93901&SiteID=1 ...Show All
Visual C++ Linking an app in debug mode (with /MDd) against static lib built in release mode (with /MD)
I remember this sort of mixing used to work fine prior to VS2005. But now it doesn't seem to. This suggests that one has to have a debug and a release versions of each library to be able to compile a debug and a release version of the application. The following short example results in an access violation exception: Compile A.* into a.lib in release mode with /MD (it doesn't matter if compiled with or without optimization): File A.h: #include <vector> class A { public : std::vector< double > v; A( int x) {} ~A(); }; File A.cpp: #include "A.h" A::~A() { } Compile app.cpp in debug mode with /MDd: File app.cpp: #include "A.h" void main() { A a(4); } The ex ...Show All
Software Development for Windows Vista RegLoadKey / RegUnLoadKey in C#
Hopefully this is the correct place to post. I have an XP application that I am porting to Vista. The app calls DllImport on advapi32.dll, and kernel32.dll. I am executing the following methods: OpenProcessToken GetCurrentProcess LookupPrivilegeValue AdjustTokenPrivileges RegLoadKey RegUnLoadKey I am receiving a null pointer in a method running the following code: /////////////////////////////////////////////////////////////////////////////////////////////////// int token = 0; int retval = 0; TOKEN_PRIVILEGES TP = new TOKEN_PRIVILEGES (); TOKEN_PRIVILEGES TP2 = new TOKEN_PRIVILEGES (); LUID RestoreLuid = new LUID (); LUID BackupLuid = new LUID (); retval = OpenProces ...Show All
.NET Development returning result of sql query in a string
Hi. I need to create a function in c# that returns the result of a query in a string, so far I have this: public string GetModules(CTP_ID) { string modules DBConnection connection = new DBConnection(); // create the data adapter SqlDataAdapter daMod = new SqlDataAdapter("select count (*) from courses where ctp_id = 'Biannual Update Courses'",connection); -- (all on one line) // create an empty data set DataSet dsMod = new DataSet(); try { connection.Open(); daMod.Fill(dsMod,"connection"); modules = this is where I want the string (modules to be the result of the query) } catch (Exception ex) { lblMessage.Text = ex.Message; } finally { close the connection connection.Clo ...Show All
SQL Server join several fields to create new field
What would be the recommendation/approach in creating a seperate field in which joins several differate fields together. I have a table with field name a, b, and c. I want the information in those fields to be populated in a seperate field, d. So instead of: a 122 b joe c st I would have: d 122 joe st Thanks! This works ... sort of. If there are any null fields, it returns nothing. So is there a way around that. Something can be built into the view that handles: if null then '' otherwise d + ' ' ...Show All
Visual C# A conversion question.
What is the inverse for the operation below if I want to get back an array of byte[]: byte [] cipherText string str1 = Convert . ToBase64String ( cipherText ) ); cipherText = Convert. Thanks. Friendly Dog wrote: Convert .FromBase64String(str1); Isn't this obvious ;) Indeed, it is "semantically" obvious for people in the know. I was not a part of that group until you enlightened me:) Many thanks. It works perfect. ...Show All
SQL Server Error while executing reports from report manager
Hi.. I have deployed reports on to the report server. When I try to open the reports from report server, I get the error," Value does not fall within the expected range." This error message appears as soon as I click on any report on the report manager. I am not able to find the cause of the error. Does anybody have any suggestions Thanks , Viva Viva1 In the directory C:\Program Files\Microsoft SQL Server\MSSQL.1 is a logfile directory for Reporting Service. In this directory, is a reporting service application log file and normally contains a more descriptive error message. It would be helpful to know what its contains. Ham ...Show All
SQL Server Help for Dynamic Grouping!!
Hello to everyone. I face a problem for gouping. I want to make dynamic grouping in report. Dynammic Grouping means, I want to provide a parameter named Group By with mutivalues. I can't hide this parameter so that user can select any one value from this dropdown and when he is click View Report, takes that value and group table rows as per parameter selection. So i want to ask if it is possible to change <groupexpression> in XML code of report dynamically as per selection. <Grouping Name="table1_CODE"> <GroupExpressions> <GroupExpression>=Fields!CODE.Value</GroupExpression> </GroupExpressions> </Grouping> This is default grouping, when i select a value from Gro ...Show All
Visual Studio Printing without the ReportViewer
In a Win Forms app, is it possible to print a report without using the ReportViewer control I want to provide a print button on a Form (like Outlook does) and then use an embedded Report to print the data so I don't really need the ReportViewer. I would want to display the PrinterDialog though and use the settings from here to control the printed Report. Is this possible too Regards Graham I figured out the print quality issue. The sample code in this post uses the drawimage improperly. The code sample on the MSDN docs shows the correct usage: http://msdn2.microsoft.com/en-us/library/ms252091.aspx the PrintPage method should call DrawImage with the PrintPageEventArgs PageBounds property like t ...Show All
Windows Forms RichTextBox Disable Autoscroll
Is there a way to disable autoscroll on an RTB control I have been highlighting text by using the find command and changing the backfround colour. The annoying thing is, this can make the screen scroll: //Remember the cursor position and selection length int temp_pos = richTextBox1->SelectionStart; int temp_select = richTextBox1->SelectionLength; richTextBox1->BeginUpdate(); //Do highlighting using RTB's Find method while(MemberWord^ mw = dynamic_cast<MemberWord^>(retrievedPackage->Members->Dequeue())) { richTextBox1->SelectionStart = retrievedPackage->SelectionStart; for(int i = 0; i < mw->Frequency; i++) { RichTextBoxFinds searchOptions = RichTextBoxFinds::WholeWord; if( ...Show All
Visual Studio New item wizard
Hi I've made a new item wizard, and copied it to "\Microsoft Visual Studio 8\VC#\CSharpProjectItems\", and it works fine. But can I get it as a quick access "Add new item", like Windows Form, User Control, Component and Class ...Show All
