C# console application closes on it's own as soon as it opens

Hello to all of you.
I know this is a very common problem but there seems to be no solution for me so far.
The known problem that right after build and start debugging, terminal opens and closes like a flush.
Have Tried the below already:
Console.ReadLine();
Console.ReadKey();
System.Console.ReadLine();
System.Console.ReadKey();
Ctrl+F5
Start without debugging
and a couple more.
Went to settings to see if console application was enabled (which it was).
It was working fine until this noon,when I was working on my exercise and using always "Console.ReadLine();" in order for the window to
remain open, but all of the sudden it did not work for me anymore.
I have to say at this point that not a single change was done in my laptop. I also restarted just in case, but nothing's changed.
Furthermore I use version VS express windows desktop 2013 with update 4 and also Vs express windows 2013 with update 4.
Please help me and thank you very much for taking the time to read this.

I know this is a very common problem but there seems to be no solution for me so far.
The known problem that right after build and start debugging, terminal opens and closes like a flush.
Have Tried the below already:
Console.ReadLine();
Console.ReadKey();
System.Console.ReadLine();
System.Console.ReadKey();
Ctrl+F5
Start without debugging
and a couple more.
It was working fine until this noon,when I was working on my exercise and using always "Console.ReadLine();" in order for the window to
remain open, but all of the sudden it did not work for me anymore.
Is the code you're trying to debug in a source code file which is specified as part of the
project being built/run?
A common mistake is to open a new source code file in the IDE, add code, then try to run
or debug it. If the new source code file isn't listed as part of the active project
in
the Solution Explorer window, then it will not get compiled and added to the project's
target (.exe). So what gets executed/run doesn't include the code on the screen in the
IDE editor.
- Wayne

Similar Messages

  • Acrobat 8.1.7 closes on it's own in Windows 7

    I had no problems with 8.0 in XP but upgraded to Windows 7.  When I open a PDF or even when I just run the application the program starts and after a few seconds closes on it's own.  I upgraded to 8.1.7 and still hte same.  I can open the file in reader so I am stumped.  Any ideas or suggestions are welcome.

    IAJusth,
    Have you attempted to run Adobe Acrobat in compatibility mode for Windows XP? Right click on the application, select "troubleshoot compatibility" and follow the on screen prompts.
    Also, should you require additional assistance Microsoft does have an official Windows 7 Support Forum located here http://tinyurl.com/9fhdl5. It is supported by product specialists as well as engineers and support teams. You may want to check the threads there for additional support.
    Jessica
    Microsoft Windows Client Team

  • Code source works fine from console application but not from SharePoint interface

    Hi;
    Please can you help
    me to understand why my code below works fine from console application (VS 2010) and not working from interface of my SharePoint collection site :
    From console application : the subsite is created and I can to open without any problem
    From Sharepoint GUI : the subsite is created but impossible
    to open subsite : error 404 page not found ?
    The subsite creation is very long (2 minutes) and in concole application When I try to open the subsite just after its creation I have page not found and I must waits (several refresh) more time to open the subsite correctly.
    Can be I must to display a PoPup to show the progress creation ?
    using System;
    using System.Security.Permissions;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Security;
    using Microsoft.SharePoint.Utilities;
    using Microsoft.SharePoint.Workflow;
    namespace CreateSubSiteClients.EventReceiver1
        public class EventReceiver1 : SPItemEventReceiver
            public override void ItemAdded(SPItemEventProperties properties)
                     base.ItemAdded(properties);
                     try
                         SPWeb web = properties.OpenWeb();
                         if (properties.List.Title == "REFCLIENTS")
                             SPListItem curItem = properties.ListItem;
                             string name = properties.ListItem["SITE"].ToString();
                             curItem["SiteUrl"] = web.Url + "/" + name;
                             SPWeb rootWeb = web.Site.RootWeb;
                             SPWebTemplateCollection webTemplates = rootWeb.GetAvailableWebTemplates(1036);
                             SPWebTemplate webTemplate = null;
                             String webTemplateName = "ModeleSiteCourrier";
                             String webTemplateSearchName = "";
                             for (int i = 0; i < webTemplates.Count; i++)
                                 webTemplateSearchName = webTemplates[i].Name.ToString();
                                 if (webTemplateSearchName.Contains(webTemplateName))
                                     webTemplate = webTemplates[webTemplateSearchName];
                                     break;
                           SPWeb newSite = web.Webs.Add(name, name, name, Convert.ToUInt16(1036), webTemplate, false, false);
                            newSite.Navigation.UseShared = true;
                            newSite.Update();
                            newSite.Close();
                            Console.WriteLine("Le site suivant a été crée", name);
                     catch (Exception ex)
                         properties.Status = SPEventReceiverStatus.CancelWithError;
                         properties.ErrorMessage = ex.Message.ToString();
                         properties.Cancel = true;
    Regards

    Hi,
    To create subsite using event receiver in SharePoint Empty Project, you can refer to:
    Sharepoint 2010 event handler to create subsites
    To display a PoPup to show the progress creation, you can use:  MessageBox.Show("Hello, world.");
    More information:
    MessageBox.Show Method (String)
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Use sql notification for console application C#

    I have developed ucma C# console application which sends IM  to users. 
    Now I want to send IM if any new entry is added in the table 
    So i want to use query notification .
    I have enabled service broker on my database .
    And I have added code for sqldepedency  in my code file.
    as follows.
    public static void Main(string[] args)
    UCMASampleInstantMessagingCall ucmaSampleInstantMessagingCall =
    new UCMASampleInstantMessagingCall();
    ucmaSampleInstantMessagingCall.connectionfunction();
    public void connectionfunction()
    string connectionString = @"Data Source=PIXEL-IHANNAH2\PPINSTANCE;User ID=sqlPPUser;Password=ppuser1;Initial Catalog=Ian;";
    SqlDependency.Stop(connectionString);
    SqlConnection sqlConnection = new SqlConnection(connectionString);
    string statement = "select * from dbo.tblTest";
    SqlCommand sqlCommand = new SqlCommand(statement, sqlConnection);
    // Create and bind the SqlDependency object to the command object.
    SqlDependency dependency = new SqlDependency(sqlCommand, null, 0);
    SqlDependency.Start(connectionString);
    dependency.OnChange += new OnChangeEventHandler(dependency_OnChange);
    private void dependency_OnChange(object sender, SqlNotificationEventArgs e)
    ucmaSampleInstantMessagingCall.run()
    private void Run() { // Initialize and startup the platform. Exception ex = null; try { // Create the UserEndpoint _helper = new UCMASampleHelper(); _userendpoint = _helper.CreateEstablishedUserEndpoint();
    Now I want to run this application in the background , so f any new entry is added it will notify my C# application and call run function.
    i tried above code but it was not working.
    Sample code is avaliableon net but it is for form application and we can see output if we run the form application .
    so if i want to run my C# application what should I do?

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Configuration;
    using System.Security.Principal;
    using System.Security.Cryptography.X509Certificates;
    using System.Net;
    using System.Threading;
    using System.Diagnostics;
    using Microsoft.Rtc.Collaboration;
    using Microsoft.Rtc.Signaling;
    using System.Runtime.InteropServices;
    //using Microsoft.Rtc.Collaboration.Sample.Common;
    namespace UserPresence
    class UCMASampleInstantMessagingCall
    #region Locals
    // The information for the conversation and the far end participant.
    // Subject of the conversation; will appear in the center of the title bar of the
    // conversation window if Microsoft Lync is the far end client.
    private static String _conversationSubject = "The Microsoft Lync Server!";
    // Priority of the conversation will appear in the left corner of the title bar of the
    // conversation window if Microsoft Lync is the far end client.
    private static String _conversationPriority = ConversationPriority.Urgent;
    // The Instant Message that will be sent to the far end.
    private static String _messageToSend = "Hello World! I am a bot, and will echo whatever you type. " +
    "Please send 'bye' to end this application.";
    private InstantMessagingCall _instantMessaging;
    private InstantMessagingFlow _instantMessagingFlow;
    //private ApplicationEndpoint _applicationEndpoint;
    private UserEndpoint _userendpoint;
    private UCMASampleHelper _helper;
    private static SqlDependency dependency;
    private static string connectionString = @"Data Source=MyServer;Initial Catalog=MyDatabase;Integrated Security=SSPI";
    // Event to notify application main thread on completion of the sample.
    private AutoResetEvent _sampleCompletedEvent = new AutoResetEvent(false);
    #endregion
    #region Methods
    /// <summary>
    /// Instantiate and run the InstantMessagingCall quickstart.
    /// </summary>
    /// <param name="args">unused</param>
    //private string _helper;
    //UCMASampleHelper _helper = new UCMASampleHelper();
    public static void Main(string[] args)
    UCMASampleInstantMessagingCall ucmaSampleInstantMessagingCall =
    new UCMASampleInstantMessagingCall();
    var connection = new SqlConnection(connectionString);
    SqlDependency.Start(connectionString);
    SqlConnection connection = new SqlConnection(connectionString);
    connection.Open();
    SqlCommand command = new SqlCommand(
    "select col1 from dbo.tblTest",
    connection);
    // Create a dependency (class member) and associate it with the command.
    dependency = new SqlDependency(command, null, 5);
    // Subscribe to the SqlDependency event.
    dependency.OnChange += new OnChangeEventHandler(onDependencyChange);
    // start dependency listener
    SqlDependency.Start(connectionString);
    //ucmaSampleInstantMessagingCall.Run();
    private static void onDependencyChange(Object o, SqlNotificationEventArgs args)
    run();
    private void Run()
    // Initialize and startup the platform.
    Exception ex = null;
    try
    // Create the UserEndpoint
    _helper = new UCMASampleHelper();
    _userendpoint = _helper.CreateEstablishedUserEndpoint();
    Console.Write("The User Endpoint owned by URI: ");
    Console.Write(_userendpoint.OwnerUri);
    Console.WriteLine(" is now established and registered.");
    List<string> _Users = new List<string>();
    _Users.Add("sip:[email protected]");
    _Users.Add("sip:[email protected]");
    foreach (string useruri in _Users)
    // Setup the conversation and place the call.
    ConversationSettings convSettings = new ConversationSettings();
    convSettings.Priority = _conversationPriority;
    convSettings.Subject = _conversationSubject;
    // Conversation represents a collection of modes of communication
    // (media types)in the context of a dialog with one or multiple
    // callees.
    //Convers conver =new ConversationParticipant
    Conversation conversation = new Conversation(_userendpoint, convSettings);
    InstantMessagingCall _instantMessaging = new InstantMessagingCall(conversation);
    // Call: StateChanged: Only hooked up for logging. Generally,
    // this can be used to surface changes in Call state to the UI
    _instantMessaging.StateChanged += this.InstantMessagingCall_StateChanged;
    // Subscribe for the flow created event; the flow will be used to
    // send the media (here, IM).
    // Ultimately, as a part of the callback, the messages will be
    // sent/received.
    _instantMessaging.InstantMessagingFlowConfigurationRequested +=
    this.InstantMessagingCall_FlowConfigurationRequested;
    // Get the sip address of the far end user to communicate with.
    //String _calledParty = "sip:" +
    // UCMASampleHelper.PromptUser(
    // "Enter the URI of the user logged onto Microsoft Lync, in the User@Host format => ",
    // "RemoteUserURI");
    // Place the call to the remote party, without specifying any
    // custom options. Please note that the conversation subject
    // overrides the toast message, so if you want to see the toast
    // message, please set the conversation subject to null.
    // _instantMessaging.Conversation()
    _instantMessaging.BeginEstablish(useruri, new ToastMessage("Hello Toast"), null,
    CallEstablishCompleted, _instantMessaging);
    catch (InvalidOperationException iOpEx)
    // Invalid Operation Exception may be thrown if the data provided
    // to the BeginXXX methods was invalid/malformed.
    // TODO (Left to the reader): Write actual handling code here.
    ex = iOpEx;
    finally
    if (ex != null)
    // If the action threw an exception, terminate the sample,
    // and print the exception to the console.
    // TODO (Left to the reader): Write actual handling code here.
    Console.WriteLine(ex.ToString());
    Console.WriteLine("Shutting down platform due to error");
    _helper.ShutdownPlatform();
    // Wait for sample to complete
    _sampleCompletedEvent.WaitOne();
    // Just to record the state transitions in the console.
    void InstantMessagingCall_StateChanged(object sender, CallStateChangedEventArgs e)
    Console.WriteLine("Call has changed state. The previous call state was: " + e.PreviousState +
    "and the current state is: " + e.State);
    // Flow created indicates that there is a flow present to begin media
    // operations with, and that it is no longer null.
    public void InstantMessagingCall_FlowConfigurationRequested(object sender,
    InstantMessagingFlowConfigurationRequestedEventArgs e)
    Console.WriteLine("Flow Created.");
    _instantMessagingFlow = e.Flow;
    // Now that the flow is non-null, bind the event handlers for State
    // Changed and Message Received. When the flow goes active,
    // (as indicated by the state changed event) the program will send
    // the IM in the event handler.
    _instantMessagingFlow.StateChanged += this.InstantMessagingFlow_StateChanged;
    // Message Received is the event used to indicate that a message has
    // been received from the far end.
    _instantMessagingFlow.MessageReceived += this.InstantMessagingFlow_MessageReceived;
    // Also, here is a good place to bind to the
    // InstantMessagingFlow.RemoteComposingStateChanged event to receive
    // typing notifications of the far end user.
    _instantMessagingFlow.RemoteComposingStateChanged +=
    this.InstantMessagingFlow_RemoteComposingStateChanged;
    private void InstantMessagingFlow_StateChanged(object sender, MediaFlowStateChangedEventArgs e)
    Console.WriteLine("Flow state changed from " + e.PreviousState + " to " + e.State);
    // When flow is active, media operations (here, sending an IM)
    // may begin.
    if (e.State == MediaFlowState.Active)
    // Send the message on the InstantMessagingFlow.
    _instantMessagingFlow.BeginSendInstantMessage(_messageToSend, SendMessageCompleted,
    _instantMessagingFlow);
    private void InstantMessagingFlow_RemoteComposingStateChanged(object sender,
    ComposingStateChangedEventArgs e)
    // Prints the typing notifications of the far end user.
    Console.WriteLine("Participant "
    + e.Participant.Uri.ToString()
    + " is "
    + e.ComposingState.ToString()
    private void InstantMessagingFlow_MessageReceived(object sender, InstantMessageReceivedEventArgs e)
    // On an incoming Instant Message, print the contents to the console.
    Console.WriteLine(e.Sender.Uri + " said: " + e.TextBody);
    // Shutdown if the far end tells us to.
    if (e.TextBody.Equals("bye", StringComparison.OrdinalIgnoreCase))
    // Shutting down the platform will terminate all attached objects.
    // If this was a production application, it would tear down the
    // Call/Conversation, rather than terminating the entire platform.
    _instantMessagingFlow.BeginSendInstantMessage("Shutting Down...", SendMessageCompleted,
    _instantMessagingFlow);
    _helper.ShutdownPlatform();
    _sampleCompletedEvent.Set();
    else
    // Echo the instant message back to the far end (the sender of
    // the instant message).
    // Change the composing state of the local end user while sending messages to the far end.
    // A delay is introduced purposely to demonstrate the typing notification displayed by the
    // far end client; otherwise the notification will not last long enough to notice.
    _instantMessagingFlow.LocalComposingState = ComposingState.Composing;
    Thread.Sleep(2000);
    //Echo the message with an "Echo" prefix.
    _instantMessagingFlow.BeginSendInstantMessage("Echo: " + e.TextBody, SendMessageCompleted,
    _instantMessagingFlow);
    private void CallEstablishCompleted(IAsyncResult result)
    InstantMessagingCall instantMessagingCall = result.AsyncState as InstantMessagingCall;
    Exception ex = null;
    try
    instantMessagingCall.EndEstablish(result);
    Console.WriteLine("The call is now in the established state.");
    catch (OperationFailureException opFailEx)
    // OperationFailureException: Indicates failure to connect the
    // call to the remote party.
    // TODO (Left to the reader): Write real error handling code.
    ex = opFailEx;
    catch (RealTimeException rte)
    // Other errors may cause other RealTimeExceptions to be thrown.
    // TODO (Left to the reader): Write real error handling code.
    ex = rte;
    finally
    if (ex != null)
    // If the action threw an exception, terminate the sample,
    // and print the exception to the console.
    // TODO (Left to the reader): Write real error handling code.
    Console.WriteLine(ex.ToString());
    Console.WriteLine("Shutting down platform due to error");
    _helper.ShutdownPlatform();
    private void SendMessageCompleted(IAsyncResult result)
    InstantMessagingFlow instantMessagingFlow = result.AsyncState as InstantMessagingFlow;
    Exception ex = null;
    try
    instantMessagingFlow.EndSendInstantMessage(result);
    Console.WriteLine("The message has been sent.");
    catch (OperationTimeoutException opTimeEx)
    // OperationFailureException: Indicates failure to connect the
    // IM to the remote party due to timeout (called party failed to
    // respond within the expected time).
    // TODO (Left to the reader): Write real error handling code.
    ex = opTimeEx;
    catch (RealTimeException rte)
    // Other errors may cause other RealTimeExceptions to be thrown.
    // TODO (Left to the reader): Write real error handling code.
    ex = rte;
    finally
    // Reset the composing state of the local end user so that the typing notifcation as seen
    // by the far end client disappears.
    _instantMessagingFlow.LocalComposingState = ComposingState.Idle;
    if (ex != null)
    // If the action threw an exception, terminate the sample,
    // and print the exception to the console.
    // TODO (Left to the reader): Write real error handling code.
    Console.WriteLine(ex.ToString());
    Console.WriteLine("Shutting down platform due to error");
    _helper.ShutdownPlatform();
    #endregion
    So i want to call run method when new entry is added in the database . and this application is not like any asp.net form application . In form application we display data when programs loads as like your RefreshDataWithSqlDependency
    function . But in my application my application will run (send IM) when any new entry is added in the database . As I need running application to achieve notification , what kind of changes are required?

  • How to hide keyboard input in a Java console application?

    I am developing a console application that request a password, but I don't wanna the password to be shown in the console when the user enters it.
    The source code is something like that:
    System.out.print("Password: ");
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in)) ;
    String password = "";
    try
           password  = in.readLine() ;
    catch (IOException e) {}
    return s ;

    Moderator advice: Please don't post in threads that are long dead and don't hijack another poster's thread. When you have a question, start your own topic. Feel free to provide a link to an old post that may be relevant to your problem.
    Moderator action: Locking this thread.
    Moreover, your question is answered in this thread. Didn't you at least read it before resurrecting it?
    db

  • Hi..handling events in console applications

    Hi,
    Can anyone tell me how to handle events in cosole applications...
    I want to trap the event when a user closes the the console window....
    THANKS IN ADVANCE
    Rama

    Hi,
    No, I don't think so. A console application can only read from standard input (and you can read the return key that way). But I don't think that you can detect if ctrl is held down by a user, I think you need an UI for that, but I'm not 100% sure since I haven't had the need for it.
    /Kaj

  • EAX Console Application encounters errors (cant use it) - Audigy 2 ZS

    I bought my Audigy 2 ZS in late 2006 and i used to enjoy the EAX Console, but its always been flaky. Often I have to reinstall it from the CD and that is total crap. I have the latest drivers and the EAX console crashes on me. Where can I get the newest version?
    EAX Console Application has encountered a problem and needs to close. We are sorry for the inconvenience.
    The Creative Volume console works fine, but I used to like messing witht he EAX console while listening to music, its much better than all the crappy winamp plugins out there, but it seems I can no longer use it.

    I'm on Windows XP Pro SP3. I dont see why the app breaks constantly. Even when I got it brand new it failed within a month or 2. The only way I've gotten it to work is to install the drivers and app off the cd constantly. And that is ridiculous. The new drivers shouldnt break anything either, maybe they can update the apps and put them online. So what if someone that doesnt have the soundcards can attempt to use them, I paid good money for my card, because I had creative soundcards that were very good in the past. I just wish the EAX console worked, winamp plugins suck compared to the Creative EAX [email protected]

  • Console Application not updating the database

    Dear all,
    I am new to c# development. I have a console application front end in program.cs
    I have a local database on visual studio.
    When I execute the stored procedure locally on the database the data is getting updated in the database.
    When I update the same through Console Application - the data is not appearing in the database.
    Can somebody throw light on this? Where I am missing
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    namespace AssetApp
    class Program
    static void Main(string[] args)
    bool value = true;
    while (value)
    value = getdisplay();
    //Console.ReadLine();
    //value = false;
    private static bool getdisplay()
    Console.WriteLine("-------------------------------------- ");
    Console.WriteLine("---------------------------------------");
    Console.Clear();
    Console.WriteLine("----------Asset Application------------");
    Console.WriteLine(" 1 Company Asset ");
    Console.WriteLine(" 2 Standby Laptop Register ");
    Console.WriteLine(" 3 Scrap Register ");
    Console.WriteLine(" 4 Purchase Register ");
    Console.WriteLine(" 5 Service Call Report ");
    Console.WriteLine(" 6 IT Helpdesk ");
    Console.WriteLine(" 7 Exit ");
    Console.WriteLine("---------------------------------------");
    string input = Console.ReadLine();
    switch (input)
    case "1":
    CompanyAsset();
    break;
    case "2":
    Console.WriteLine("Standy Laptop Register");
    break;
    case "3":
    Console.WriteLine("Scrap Register");
    break;
    case "4":
    Console.WriteLine("Purchase Register");
    break;
    case "5":
    Console.WriteLine("Service call Report");
    break;
    case "6":
    Console.WriteLine("IT Helpdesk");
    break;
    case "7":
    return false;
    default:
    break;
    return true;
    private static void CompanyAsset()
    Console.WriteLine("------Company Asset------------------------");
    Console.WriteLine("Type the Department Name");
    string departmentName = Console.ReadLine();
    Console.WriteLine("Type the First Name");
    string firstName = Console.ReadLine();
    Console.WriteLine("Type the Last Name");
    string lastName = Console.ReadLine();
    Console.WriteLine("Type the User Name");
    string userName = Console.ReadLine();
    Console.WriteLine("Type the Model Number");
    string modelNumber = Console.ReadLine();
    Console.WriteLine("Type the AssetTypeID");
    string assetTypeID = Console.ReadLine();
    Console.WriteLine("Type the SerialNumber");
    string serialNumber = Console.ReadLine();
    Console.WriteLine("Type the WarrantyStartDate");
    DateTime warrantyStartDate = Convert.ToDateTime(Console.ReadLine());
    Console.WriteLine("Type the WarrantyEndDate");
    DateTime warrantyEndDate = Convert.ToDateTime(Console.ReadLine());
    Console.WriteLine("Company");
    string company = Console.ReadLine();
    Console.WriteLine("EngineerID");
    string engineerID = Console.ReadLine();
    Console.WriteLine("ITHelpdeskID");
    string itHelpdeskID = Console.ReadLine();
    Console.WriteLine("EmpID");
    string empID = Console.ReadLine();
    //Handshake
    SqlConnection myNewConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\AssetApp.mdf;Integrated Security=True");
    //open the database
    myNewConnection.Open();
    //create command
    SqlCommand myCommand = myNewConnection.CreateCommand();
    //using the stored procedue to update the database using parameters add
    myCommand.CommandText = "InsertAsset";
    myCommand.CommandType = CommandType.StoredProcedure;
    myCommand.Parameters.Add(new SqlParameter("@DepartmentName", departmentName));
    myCommand.Parameters.Add(new SqlParameter("@FirstName", firstName));
    myCommand.Parameters.Add(new SqlParameter("@LastName", lastName));
    myCommand.Parameters.Add(new SqlParameter("@UserName", userName));
    myCommand.Parameters.Add(new SqlParameter("@ModelNumber", modelNumber));
    myCommand.Parameters.Add(new SqlParameter("@AssetTypeID", int.Parse(assetTypeID)));
    myCommand.Parameters.Add(new SqlParameter("@SerialNumber", serialNumber));
    myCommand.Parameters.Add(new SqlParameter("@WarrantyStartDate", warrantyStartDate));
    myCommand.Parameters.Add(new SqlParameter("@WarrantyEndDate", warrantyEndDate));
    myCommand.Parameters.Add(new SqlParameter("@Company", company));
    myCommand.Parameters.Add(new SqlParameter("@EngineerID", int.Parse(engineerID)));
    myCommand.Parameters.Add(new SqlParameter("@ITHelpdeskID", int.Parse(itHelpdeskID)));
    myCommand.Parameters.Add(new SqlParameter("@EmpID", int.Parse(empID)));
    int recordsAffected = myCommand.ExecuteNonQuery();
    if (recordsAffected == 1)
    Console.WriteLine("Successful your entry");
    else
    Console.WriteLine("Your entry is not successful");
    myNewConnection.Close();
    Console.WriteLine("");
    Console.WriteLine("Press Enter to continue");
    Console.ReadLine();
    public static void StandbyLaptopRegister()
    Console.WriteLine("-------------------------------");
    Console.WriteLine("Select the Date & Time");
    string DateTime = Console.ReadLine();
    Console.WriteLine("");
    ALTER PROCEDURE dbo.InsertAsset
    @DepartmentName NVARCHAR(50),
    @FirstName NVARCHAR(50),
    @LastName NVARCHAR(50),
    @UserName NVARCHAR(50),
    @ModelNumber NVARCHAR(50),
    @AssetTypeID INT,
    @SerialNumber NVARCHAR(50),
    @WarrantyStartDate SMALLDATETIME,
    @WarrantyEndDate SMALLDATETIME,
    @Company NVARCHAR(50),
    @EngineerID INT,
    @ITHelpdeskID INT,
    @EmpID INT
    @parameter1 int = 5,
    @parameter2 datatype OUTPUT
    AS
    /* SET NOCOUNT ON */
    BEGIN
    INSERT CompanyAsset(DepartmentName,
    FirstName,
    LastName,
    UserName,
    ModelNumber,
    AssetTypeID,
    SerialNumber,
    WarrantyStartDate,
    WarrantyEndDate,
    Company,
    EngineerID,
    ITHelpdeskID,
    EmpID)
    VALUES(@DepartmentName,
    @FirstName,
    @LastName,
    @UserName,
    @ModelNumber,
    @AssetTypeID,
    @SerialNumber,
    @WarrantyStartDate,
    @WarrantyEndDate,
    @Company,
    @EngineerID,
    @ITHelpdeskID,
    @EmpID)
    /*RETURN @@IDENTITY*/
    END
    Cheers
    Sathya

    Hello,
    Usually when I see
    AttachDbFilename=|DataDirectory| ...
    The database was added into the project via the IDE add new data source and if so make sure under the property window for the database that "Copy to Output Directory" is set to either the first or last option as the default "Copy always"
    copies the database each time you build the project thus overwrites the last time you ran the project.
    I would recommend the "Copy if Newer" which means the database is only copied if you make changes to the database. Set "Copy if newer", build run check results.
    Of course this may not be the issue but may very well be too.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Starting console applications in xmonad

    Hi,
      I am just getting started with xmonad and I really like it, but I have one problem.  If I try to launch any console applications from dmenu (vim, for instance), they don't show up.  When I quit xmonad I find that they have actually started back in the original terminal, and sometimes render it unusable.  Is there some way to launch console applications as their own windows and processes, seperate from the original terminal?  If not, do you just start them from a terminal and then move them to the correct workspace?
      For example, I put anything code that I am working on in workspace 2, but regular terminal sessions in workspace 4.  Is there a way that I can launch vim from dmenu and have it automatically moved to workspace 2, like I have done with gVim?

    Mr.Elendig wrote:
    Trilby wrote:
    beloglazov wrote:Hi Trilby, could you please explain how to add commants like "urxvt -e vim" into dmenu? Thanks!
    I'm not sure I understand - you just type it in.  This doesn't get the autocompletion option.  I suppose you could script that into it, but I wouldn't see the point.  When you type "urxvtc -e" it wouldn't really narrow down the list of possibilities.
    let it autocomplete "urxvt" for you, then add the -e vim, then press shift-enter
    Thank you guys for the replies. Actually, I didn't know that you type into dmenu a command with arguments Anyway, I've a made a small modification of dmenu_run that does what I wanted: you type in a command like bc or top; dmenu auto-completes it; and when you press enter, it runs "urxvt -e <your command>". This helps to avoid typing "urxvt -e" every time. Here is the code:
    #!/bin/sh
    cachedir=${XDG_CACHE_HOME:-"$HOME/.cache"}
    if [ -d "$cachedir" ]; then
    cache=$cachedir/dmenu_run
    else
    cache=$HOME/.dmenu_cache # if no xdg dir, fall back to dotfile in ~
    fi
    if stest -dqr -n "$cache" $PATH; then
    choice="$(stest -flx $PATH | sort -u | tee $cache | dmenu)"
    else
    choice="$(dmenu < $cache)"
    fi
    if [[ $choice ]]; then
    urxvt -e $choice
    fi

  • Running Unix Console Application on X86 Linux Target

    Hello,
    I tried to build a linux console application. I followed this tutorial http://zone.ni.com/devzone/cda/tut/p/id/5412 and it worked fine.
    The result was an executable that runs on my Windows-PC.
    But how can I run the program on my Debian-Linux machine (X86)?
    Greets Smithee

    Hi Smithee,
    The application you built was compiled with gcc for Windows. To cross-compile for a Linux PC, you would have to create your own target that calls gcc for Linux. This involves modifying plug-in VIs and possibly updating some header files. The steps in the porting process are explained in this document: http://digital.ni.com/manuals.nsf/websearch/1DE04E4CE92B5D4186257309006E1BC2.
    Michael P
    National Instruments

  • Can't access community members list in event receiver when item is updated in console application

    Hi,
    we attached an event receiver to a list in a community site template. In the ItemUpdated event we access different lists from the site. Everything is working fine when we update a list item in the web frontend logged in as Administrator (application pool
    identity Administrator).
    Updating an list item in a console application running as Administrator triggers the ItemUpdated event and accesses all lists - only the Community Member list can't be accessed.
    SPWeb spWeb = properties.OpenWeb();
    Guid communityMembersListGuid = new Guid("3b56d08b-be6b-408b-a2aa-c08722ad499b");
    SPList communityMembersList = spWeb.Lists[communityMembersListGuid];
    We added the Administrator with full access to the list, run the code with RunWithElevatedPrivileges and initialized the spSite with the account-token of the administrator. Nothing works.
    Any idea?
    Greetings Peter

    Hi,
    Please try to use the following code blow:
    SPWeb spWeb = properties.Web;
    SPList communityMembersList = spWeb.Lists["Community Members"];
    If the issue still exists, I suggest you debug your code and provide the detail error message for further research.
    Best Regards
    Dennis Guo
    TechNet Community Support

  • Getting error while creating SPSite object in console application

    Hi,
    I am getting error "The Web application at
    http://myWebApp/sites/siteCol could not be found. Verify that you have typed the URL correctly. If the URL should be serving existing content, the system administrator may need to add a new request URL mapping to the intended application." whenever
    I try to execute the below code in my console application.
    SPSite oSite = new SPSite("sitecolUrl");
    I tried to change the platform target to AnyCpu,
    I tried to wrap it with SP.RunWithElevatedPrivileges
    but all above didn't solve the error.
    Any suggestions?

    Hello,
    instead of targetting "any cpu" target x64 and be sure to target .net 3.5 (I made a post about it it could help you
    http://christopherclementen.wordpress.com/2012/03/02/windows-application-spsite-filenotfound/
    Best regards, Christopher.
    Blog |
    Mail
    Please remember to click "Mark As Answer" if a post solves your problem or
    "Vote As Helpful" if it was useful.
    Why mark as answer?

  • While rendering a project in After Effects CC (Mac) , the application closes half way, saying it quit unexpectedly, Please Help!

    So, I have created a cool project that was a lot of hard work in After Effects CC (Mac), While rendering a project in After Effects CC (Mac) , the application closes half way, saying it quit unexpectedly. Here is the link to an error log which is automatically recorded when After Effects crashes:- After Effects Crash (Mac) - Pastebin.com
    I have tried to render this project at least 5 times, shutting and restarting my computer. Please Help!
    Here is my computer specs if needed;
    Operating System: Mac OS X Mavericks version 10.9.4 (13E28)
    Processor: 2.5GHz Intel Core i5
    Memory: 4GB 1600 MHz DDR3
    Graphics: Intel HD Graphics 4000
    Screen Resolution: 13-inch (1280 x 800)
    Hard Drive: 500GB -- 186.49 GB free space.
    Thanks
    Milan

    Element 3d renders using your graphics card. Unlike After Effects, what GPU you're using matters a lot for Element.
    As it is, you don't really have one.
    You could try rendering an image sequence and then picking up your render where it left off when it crashes, but if a certain frame is just too much for your computer to handle, there's not much we can help with. I'd suggest adding a GPU that Element can use.

  • Getting Error while Execute SSIS Package from Console Application

    Dear All,
    SSIS package working fine directly.
    I got following error while execute SSIS package from C# console application.
    The connection "{79D920D4-9229-46CA-9018-235B711F04D9}" is not found. This error is thrown by Connections collection when the specific connection element is not found.
    Cannot find the connection manager with ID "{79D920D4-9229-46CA-9018-235B711F04D9}" in the connection manager collection due to error code 0xC0010009. That connection manager is needed by "OLE DB Destination.Connections[OleDbConnection]"
    in the connection manager collection of "OLE DB Destination". Verify that a connection manager in the connection manager collection, Connections, has been created with that ID.
    OLE DB Destination failed validation and returned error code 0xC004800B.
    One or more component failed validation.
    There were errors during task validation.
    Code : 
       public static string RunDTSPackage()
                Package pkg;
                Application app;
                DTSExecResult pkgResults;
                Variables vars;
                app = new Application();
                pkg = app.LoadPackage(@"D:\WORK\Package.dtsx", null);
         Microsoft.SqlServer.Dts.Runtime.DTSExecResult results = pkg.Execute();
    I have recreate the application with again new connection in SSIS.
    Still not working, Please provide solution if any one have.
    DB : SQL Server 2008 R2
    Thanks and regards,
    Hardik Ramwani

    The connection "{79D920D4-9229-46CA-9018-235B711F04D9}" is not found. This error is thrown by Connections collection when the specific connection element is not found.
    Cannot find the connection manager with ID "{79D920D4-9229-46CA-9018-235B711F04D9}" in the connection manager collection due to error code 0xC0010009. That connection manager is needed by "OLE DB Destination.Connections[OleDbConnection]"
    in the connection manager collection of "OLE DB Destination". Verify that a connection manager in the connection manager collection, Connections, has been created with that ID.
    Are you sure that you are running the same package via .NET which works fine from Visual Studio?
    By reading error message, I can say that you have copied OLEDB task from another package OR you have deleted one OLEDB connection manager. Now when package is run this task tries to use the connection manager and not found thus throws error message.
    Open all OLEDB destination tasks and you find connection manager missing. Connection Manager name should be provided there
    Cheers,
    Vaibhav Chaudhari
    MCSA - SQL Server 2012

  • Read only access to Console Application ...

    We have deployed development best practice examples in one WLS instance. So, all
    developer can run our sample examples. All developer doesn't have admin privileges.
    Some times, developer would like to get "READ ONLY " access to console application.
    They can see JDBC / JMS / connection pool information.
    Is it possible to allow READ ONLY Access to CONSOLE application ?
    TIA
    Wlstech

    I don't think this is possible in the current release.
    Kumar
    "Wlstech" <[email protected]> wrote in message
    news:3af30e21$[email protected]..
    >
    We have deployed development best practice examples in one WLS instance.So, all
    developer can run our sample examples. All developer doesn't have adminprivileges.
    Some times, developer would like to get "READ ONLY " access to consoleapplication.
    They can see JDBC / JMS / connection pool information.
    Is it possible to allow READ ONLY Access to CONSOLE application ?
    TIA
    Wlstech

Maybe you are looking for

  • Problem while creating PO (Cost center error)

    Dear Expert, While Raising PO through ME21N, we are getting an error for cost center budget exceeded for 2011. The below is the error. Budget for Cost Center 2110404 getting exceeded for year 2011. Please check Message no. ZCO_VALIDATIONS004 The cost

  • Can we get the data from two internal tables in ALV.

    hi friends i would like to display the data using two internal tables using alv grid.please guide me.

  • How to insert custom code in HTM

    Hello, I need to insert some custom Javascript in the head, start, and end of my HTML files. Unfortunately, RoboHelp does not appear to offer this feature. It is really a big surprise since I can get this code in there using a number of other, much l

  • Shrink,alter table move

    hi This is the scenerio a,b,c: distinct blocks f:free blocks Assume the extent is like: aaafffccccbbfb after shrink does it become like aaabbbccccffff or aaafffccccbbbf

  • The spry horizontal submenu appear on top of screen in IE

    why is it that in IE the spry submenu is opened on the top of the screen and not below the menu and how can this be fixed...i have used dreamweaver  CS3 and found this to be a major issue but cannot find an answer to it?