User Profile

Collapse

Profile Sidebar

Collapse
Shani Aulakh
Shani Aulakh
Last Activity: May 29 '08, 02:20 PM
Joined: Nov 9 '07
Location: Waterloo, ON
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Shani Aulakh
    started a topic newbie question

    newbie question

    Hi there,

    I have a following question and it is related to vfp. I created a form method called AddInvoiceToPri ntQueue.

    The following is the code i added.

    [HTML]LPARAMETERS tinvoice_id, tinvoice_no, tuser_id, tcomputer_name

    INSERT INTO <PrintQueueTabl e> ;
    (invoice_id, invoice_no, user_id, computer_name, status_id);
    VALUES;
    (m.tinvoice_id, m.tinvoice_no,...
    See more | Go to post

  • Shani Aulakh
    started a topic Visual FoxPro Project help

    Visual FoxPro Project help

    Hello All,

    I am new to database development. I am working on a pre-existing database application in VFP generates invoices for various templates and then print them. Once you click on the issue button, invoices get generated for the specified templates and then they are automatically printed out. What is happening is that when you issue the invoices...proc ess gets slow and it takes time for the invoices to get printed out. I was thinking...
    See more | Go to post

  • Shani Aulakh
    started a topic random numbers
    in .NET

    random numbers

    The following code is generating files perfectly, But when i change the date on my laptop to get files with different modified times. It just overrides all the files with the recent date.

    Code:
            private void GenerateTestFiles_Click(object sender, EventArgs e)
            {
                StreamWriter outStream = null;
                string message = null;
    
                for (int i = 0; i < (100);
    ...
    See more | Go to post

  • Shani Aulakh
    replied to C#: Exception handling
    in .NET
    okay. So, for exceptions..I can give out the same message
    for example
    Code:
    catch (FileNotFoundException e)
    {
    message = "Unable to delete " + filePath + "\r\n";
    message += String.Format("Reason: {0}", e.Message);
    MessageBox.Show(message);
    }
    catch (DirectoryNotFoundException e)
    {
    message = "Unable to delete " + filePath + "\r\n";
    ...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C#: Exception handling
    in .NET
    I just want to know what exceptions i can use and how...thats why i have catch block empty
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    started a topic C#: Exception handling
    in .NET

    C#: Exception handling

    Hi All,

    I can't find any good examples of throwing exceptions. I have the following code. I want to include all the possible exceptions i can. Help me out on this. I am just moving away from console object and moving towards exception object.

    Code:
            public int DeleteFilesOlderThan(int Days, int Hrs, int Mins, string filter)
            {
                DateTime dt = GetRelativeDateTime(Days, Hrs, Mins);
    ...
    See more | Go to post

  • Shani Aulakh
    replied to C#: generating random files
    in .NET
    How do i use the following code to create files with different filter?

    Code:
            private void button1_Click(object sender, EventArgs e)
            {
                StreamWriter outStream = null;
                string filename = "output.txt";
                string message = null;
    
                for (int i = 0; i < (1000); i++)
                {
                    try
    ...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    started a topic C#: generating random files
    in .NET

    C#: generating random files

    Hi All,

    Can anyone help me with a method that could generate random dummy files with extensions..(.t xt, .log, .exe) in a specified folder?
    See more | Go to post

  • Shani Aulakh
    started a topic C#: help with coding
    in .NET

    C#: help with coding

    Hi All,
    I have the following class which deletes files older than X number of days and with specific extension. I dont see any error in the code from my point of you. Please, can anyone double check for me because when i m debuging it, files are not getting deleted. Thanks:)
    Code:
    using System;
    using System.IO;
    using System.Collections;
    
    namespace Files_ExtLib1
    {
        public class FolderWatcher
    ...
    See more | Go to post

  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    i put a breakpoint to check it throughly. this is the FolderWatcher.c s class. I modified the code using DateTime object. I think FolderPath is not defined in the current directory
    Code:
    using System;
    using System.IO;
    using System.Collections;
    
    namespace Files_ExtLib1
    {
        public class FolderWatcher
        {
            string m_FolderPath;
    
            public FolderWatcher()
    ...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    I created three textboxes to enter days, mins, hrs and a combo box for extension on my form.

    this wouldn't work?
    Code:
            private void DeleteFiles_Click(object sender, EventArgs e)
            {
                FolderWatcher fw = new FolderWatcher();
                fw.FolderPath = @"c:\csharp"; // FolderName
                OpenFileDialog OpenFileDialog1 = new OpenFileDialog();
    ...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    okay i will check that out.......i want to know another thing. I wrote the following code to create text files and to create multiple text files i guess i can run the code in a loop. but i want to generate dummy files using .txt, .log, .exe file format in button GenerateTestFil es eventhandler

    Code:
    using System;
    using System.IO;
    
    class FileTest
    {
        static void Main()
        {
    ...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    nopes, I am not getting any exceptions printed out
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    okay i did some modification in my class...but its not deleting specific files from event handler...
    [Code]
    using System;
    using System.IO;
    using System.Collecti ons;

    namespace Files_ExtLib1
    {
    public class FolderWatcher
    {
    string m_FolderPath;

    public FolderWatcher()
    {
    //
    // TODO: Add constructor...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    Before when i was compiling the application, it was showing in pending checkins that files successfully deleted. but not anymore:S
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    can you check if this is coded properly using date time object
    Code:
            public static DateTime GetRelativeDateTime(int days, int hours, int minutes)
            {
                return DateTime.Now.AddDays(-days).AddHours(-hours).AddMinutes(-minutes);
            }
    
            public int DeleteFilesOlderThan(DateTime dt)
            {
                string[] older = FilesOlderThan(dt);
    ...
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    replied to C# App: Exception Handling
    in .NET
    Thanks, But when i debug the application, the files get deleted but i dont see the msg showing Files successfully deleted.
    See more | Go to post

    Leave a comment:


  • Shani Aulakh
    started a topic C# App: Exception Handling
    in .NET

    C# App: Exception Handling

    Hi All,

    Is it the right way of handling exception in a method?

    Code:
            public int DeleteFilesOlderThan(int days, int hrs, int mins)
            {
                string[] older = FilesOlderThan(Days, Hrs, Mins);
                int count = 0;
                foreach (string file in files)
                {
                    try
                    {
                        File.Delete(file);
    ...
    See more | Go to post

  • Are you only allowed to define one pattern? ie, "*.txt"? Or
    can you define multiple patterns? ie, "*.txt; *.exe; *.log"?
    See more | Go to post

    Leave a comment:


  • I checked this peice of code using cosole application and it worked. I used a different coding method though. This is the class that monitors and deletes Files older than X number of days
    Code:
    using System;
    using System.IO;
    using System.Collections;
    
    namespace Files_ExtLib1
    {
        public class FolderWatcher
        {
            string m_FolderPath;
    
            public FolderWatcher()
    ...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...