Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Trak4Net

@Trak4Net
About
Posts
38
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Suggestion required for Accounting Software core infrastructure VS2010 C# MySql
    T Trak4Net

    I am not an accountant nor have I ever worked on any accounting software, but I have dealt with database applications a lot. Your suggested records per year of 50-80K will definitely not be an issue for a database table on platforms like MySQL or MSSQL or Oracle or the likes, unless you are running wide open queries such as (select * from table) without any filter or limitation on rows returned. Database design can become complicated if you want a very efficient means of storing your data. You may look over your required data several times and see if there are relations to break out into separate tables as much as possible and use primary keys, foreign keys and joins to bring your data together. Such as your "year" you could create a table that contains a primary key, year identifier and other year associated data and then that primary key would be a foreign key in your transaction table to match those transactions to that year etc. Hopefully that kind of makes some sense and helps in some way.

    C# question csharp asp-net database mysql

  • Using Thread is not successful
    T Trak4Net

    You should read up about making thread-safe calls to controls here is one link http://msdn.microsoft.com/en-us/library/ms171728.aspx[^] Anytime you access a control from a thread other than the thread the control was created on you will need to use Invoke or BeginInvoke to modify. Usually if there are several common controls I create a method that accepts a control as a parameter as well as the text to set and inside that method it checks if invoke is required. Here is an example of something you could do. You don't show enough code to know exactly what you are trying but this can be modified to work with different controls etc. Hope this is helpful.

        /// /// delegate to invoke when invoke required
        /// 
        private delegate void ChangeTextDel(System.Windows.Forms.TextBox obj, string newtext);
    
        /// /// Changes the text.
        /// 
        /// The obj.
        /// The newtext.
        private void ChangeText(System.Windows.Forms.TextBox obj, string newtext)
        {
            if (obj.InvokeRequired)
            {
                obj.Invoke(new ChangeTextDel(ChangeText), new object\[\] { obj, newtext });
            }
            else
            {
                obj.Text = newtext;
            }
        }
    

    //from thread
    ChangeText(txtLopDiaChi, "my new text value");

    C# question

  • Difference Between BeginGetResponse and GetResponse
    T Trak4Net

    Some more investigation turns out this is a known issue. Apparently it blocks during the name resolution so does not return immediately as you would think. Sorry, I should have looked into it a little more before replying. http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/2cb74a7e-6e8f-4d05-b86a-2401df5d2ed3/[^]

    C# csharp javascript com help tutorial

  • Application Level Key Shortcut
    T Trak4Net

    As a side note to your answer you also need to set the KeyPreview property to true for the form.

    C# question

  • Difference Between BeginGetResponse and GetResponse
    T Trak4Net

    I'm thinking you must have missed something initially, BeginGetResponse should return immedialtely. The only reason I would see to run that in a dedicated thread is if you want to worry about a timeout or want to ensure the asynchronous method completes like the example, as the method will block waiting for the ManualResetEvent to be set. Using the ManualResetEvent is for situations where you can't process the next step until that process has completed.

    C# csharp javascript com help tutorial

  • Dynamically Insert single record into MS access from SQL server
    T Trak4Net

    If you have two datasets 1) from MSSQL 2) from MS Access and all column names and table names match you should be able to iterate the datatables in the datasets and us importrow method to copy a row from one to the other and then use data adapter to execute update command and should use the assigned insert/update commands assigned to the data adapter to populate the data into the database.

    C# database sql-server sysadmin data-structures security

  • Difference Between BeginGetResponse and GetResponse
    T Trak4Net

    BeginGetResponse will execute the method in the AsyncCallBack asynchronously. If you do like in the MSDN example then it will wait for that asynchronous operation to finish this is the code that will cause it to wait and also implements a timeout method so if the asynchronous operation takes to long it will end the asynchronous operation.

    // this line implements the timeout, if there is a timeout, the callback fires and the request becomes aborted
    ThreadPool.RegisterWaitForSingleObject (result.AsyncWaitHandle, new WaitOrTimerCallback(TimeoutCallback), myHttpWebRequest, DefaultTimeout, true);

      // The response came in the allowed time. The work processing will happen in the
      // callback function.
      allDone.WaitOne();
    
    C# csharp javascript com help tutorial

  • Track two types of values within one variable
    T Trak4Net

    I would be more inclined to use the enum over abstract classes and interface for something like this. Unless there is a deeper level of programming that isn't being shown I would stick with simplicity. This would be my interpetation of the object you are wanting also with a nice ToRateString() method so you can use the rate object to easily display your value in preformatted string.

    Rate r = new Rate(ENRateType.Dollar, 5.58d);
    //r.ToRateString() would display $5.58

       public enum ENRateType { Dollar, Percent }
    
       public class Rate
       {
           public Rate()
           {
               RateType = ENRateType.Dollar;
               Value = 0d;
           }
    
           public Rate(ENRateType rateType, double value) : this()
           {
               RateType = rateType;
               Value = value;
           }
    
           public ENRateType RateType {get; internal set;}
           public double Value { get; internal set; }
    
           public string ToRateString()
           {
               if (RateType == ENRateType.Dollar) return "$" + Value.ToString("0.00");
               return Value.ToString("0.000") + "%";
           }
    
       }
    
    C# beta-testing question code-review

  • Using Thread is not successful
    T Trak4Net

    I think you are doing this backwards. The invoke back to the UI thread will be blocked until your long processing task is finished. You should actually be trying to do something like this

    string sourceFile, destinationFile;

       private void ShowLoadingIcon()
       {
           if (InvokeRequired)
           {
               this.Invoke(new MethodInvoker(ShowLoadingIcon));
    
           }
           else
           {
               pixLoadingIcon.Visible = true;
           }
       }
    
    
    
       private void btnConvert\_Click(object sender, EventArgs e)
       {
           ShowLoadingIcon();
    
           //start thread to process long running task
           System.Threading.Thread t = new System.Threading.Thread(() =>
           {
               ConvertFiles(sourceFile, destinationFile);
           });
    
           t.Start();
    
       }
    
    
       private void ConvertFiles(string src, string dest)
       {
           //long running task to convert files
       }
    
    C# question

  • manifest files
    T Trak4Net

    If your application requires elevated privileges and the user is on windows 7 with UAC enabled then you really can't get around it. Even builtin operating system functions prompt you when it needs elevated access. Even if you are logged in with administrative rights it will prompt you to run the process. This can only be changed by UAC settings either local policy or domain policy, however that opens a security risk to the machine, also if you disable UAC and the user does not have the proper privileges then you are looking at exceptions occuring from not having the correct access. Unless of course they right click and choose "run as administrator".

    C# csharp question

  • CGI in Java - Legacy but interesting (for educational purposes)
    T Trak4Net

    With the batch file maybe redirecting the output? http://www.robvanderwoude.com/battech_redirection.php[^] Interesting topic, I imagine you are getting the 404 because you are expecting the CGI_Java to be passed as a command line argument. I don't think the browser works that way. Have never tried anything like this but wonder if any querystring variables would be passed as command args like... http://localhost/java.exe?CGI\_Java :~ ???

    Web Development java question csharp html help

  • retain scrollbar position
    T Trak4Net

    You probably forgot because your first suggestion is the replacement for the deprecated property.

    [BrowsableAttribute(false)]
    [ObsoleteAttribute("The recommended alternative is Page.SetFocus and Page.MaintainScrollPositionOnPostBack. http://go.microsoft.com/fwlink/?linkid=14202")]
    public bool SmartNavigation { get; set; }

    http://msdn.microsoft.com/en-us/library/system.web.ui.page.smartnavigation.aspx[^]

    ASP.NET csharp html asp-net tutorial

  • retain scrollbar position
    T Trak4Net

    Thats too funny. Looks like you covered it a little better than I did though so good job to you!

    ASP.NET csharp html asp-net tutorial

  • retain scrollbar position
    T Trak4Net

    I would imagine adapting something like the accepted answer in the stackoverflow link below would work. Since this is a server control you would need to assign the attribute for the onscroll client side event. Here are a couple links you might want to check out http://forums.asp.net/t/1045266.aspx/1[^] http://stackoverflow.com/questions/1094589/maintain-scroll-position-of-a-div-within-a-page-on-postback[^]

    ASP.NET csharp html asp-net tutorial

  • retain scrollbar position
    T Trak4Net

    I guess I misunderstood this statement...

    Quote:

    They have not clicked the 'next' button yet. There is no postback.

    ASP.NET csharp html asp-net tutorial

  • retain scrollbar position
    T Trak4Net

    From your code post it looks like there should be a postback when the user checks a checkbox. The checkbox has the AutoPostBack property set to true, correct? Many links on this if you google here is one example http://stackoverflow.com/questions/8797798/asp-net-maintain-scroll-position-o-post-back-in-ever-updating-firefox-chrome[^]

    ASP.NET csharp html asp-net tutorial

  • Error 1 The modifier 'abstract' is not valid for this item
    T Trak4Net

    You just need to remove the abstract declaration for the event.

    namespace program.Drawing.Fields
    {
    using System;
    using System.Collections.Generic;
    using System.Runtime.CompilerServices;

    public interface IFieldHolder
    {
      event FieldChangedEventHandler FieldChanged;
    
      void AddField(Field field);
      Field GetField(FieldType fieldType);
      List<Field> GetFields();
      bool HasField(FieldType fieldType);
      void RemoveField(Field field);
      void SetFieldValue(FieldType fieldType, object value);
    }
    

    }

    C# csharp graphics help

  • Error 1 The modifier 'abstract' is not valid for this item
    T Trak4Net

    Have a read at the link below

    Quote:

    •Abstract method declarations are only permitted in abstract classes.

    Quote:

    Interfaces and interface members are abstract;

    http://msdn.microsoft.com/en-us/library/sf985hc5(v=vs.71).aspx[^] and here http://msdn.microsoft.com/en-us/library/ms173156.aspx[^]

    C# csharp graphics help

  • PrincipalContext not working in 2008 r2 Domain
    T Trak4Net

    Ok I have a better understanding now. Just out of curiousity, if the user is allowed to logon to the webserver locally does that have any effect on this method working? Or is it failing when any restriction is in place? Just wondering if server 2008 is not allowing the authentication because that web server is not one of the allowed machines for the user to log onto. (sorry I don't have my 2008 R2 setup for testing this right now)

    .NET (Core and Framework) sysadmin help

  • PrincipalContext not working in 2008 r2 Domain
    T Trak4Net

    Is your web server in a DMZ and unable to connect to the Active Directory server? If the web server is not in a restricted portion of your network and has access to the active directory server that method should still work. Have you verified you are passing the correct domain name value? Just thought I'd ask since you moved from 2003 server to 2008R2 server and wasn't sure if domain name changed.

    .NET (Core and Framework) sysadmin help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups