User Profile

Collapse

Profile Sidebar

Collapse
cloud255
cloud255
Last Activity: Apr 9 '11, 01:34 PM
Joined: Jun 23 '08
Location: Pretoria, South Africa
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Saving a password in the registry is really not a good idea. If your application is using a database the user credentials should be hashed and stored in the DB.

    If you are not using a database you could store the password in the application's config file and then encrypt the relevant part of the config file.

    If you insist on using the registry you could try to name the key something other than password, encrypt the actual...
    See more | Go to post

    Leave a comment:


  • You have not assigned your progress bar to the collection of controls of the form object.

    I have added 2 lines of code (23 and 24). That should solve your problem.

    The progress bar control will not render until you give it a parent and call she show method. You could have used the designer to add the progress bar to the form, that would have generated the missing code for you in the Designer.cs file.

    ...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to SQL NULL value logic
    I understand it returning NULL, but that is the essence of my problem with this scenario. You can never retrieve any meaningful value from an operation using a NULL. So why even allow it?
    Most programming languages throw exceptions for exactly this reason, if feel SQL should too.

    Does that mean that every single variable must be checked each time that it is used (calling the isnull() function) and manually raising an exception...
    See more | Go to post

    Leave a comment:


  • cloud255
    started a topic SQL NULL value logic

    SQL NULL value logic

    Hey,

    I was playing around with SQL (SQL Server 2008) toady and noticed something I think is really strange:

    Code:
    select 1/null -- returns null
    Why is this operation allowed? Why is any mathematical operation allowed on NULL?

    NULL as I know it in programming is an undefined value. In math, when dividing by 0 you get an undefined value.
    Thus NULL = x/0 ?

    SQL does throw divide...
    See more | Go to post

  • cloud255
    replied to Tracking upload progress
    Hi,

    Could you post your full code please.
    Check the background worker class which contains DoWork and ProgressChanged members. The DoWork class will allow you to perform the download in the background on a separate thread while the ProgressChanged will allow you to update the download progress in real time.
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to C# Classes
    I read once somewhere that its a good practice to keep each method within a class to a length of 24 lines of code or less. Of course you cannot always have tiny methods like that, but the principle is good, check if you could optimize and shorten any of your methods.

    Secondly check that your code comments are not bloated, too many comments really don't help, on the other side of that coin I do hope, for the sanity of whoever is to maintain...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to Cannot Convert string to class type
    That is exactly what I said earlier, you have a class number_type as a property, but the number_type cannot have a string directly assigned to it BECAUSE it is a class. C# does not know how to convert a string into an instance of your custom class.

    Does number_type have a string property as a member? If so you can assign the value to that member:

    Code:
    obj.number_type.MyString = dropdownlist1.selectedItem.value;
    ...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to Cannot Convert string to class type
    Could you post the entire class definition for 'number_type'?
    If I understand the situation correctly, you have an object called obj one of its members is a number_type object. This object you say is a class. If this is correct the code will never work. C# does not know how to change a string into a number_type (which you defined).

    Try instead to add a string variable to the obj class and assign the value to that variable.
    See more | Go to post

    Leave a comment:


  • You haven't provided any C# code which may be giving you errors, so perhaps you meant to post this in the MySQL forum?

    My SQL knowledge is not too great, but I believe you could create a temp table containing all the values which need to be updated, you can then execute a cursor on that table calling an insert statement for each row in the temp table to create a new entry in your original table.

    If you did want to do it...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to Get Database data using c#
    You create a connection, you open it, create the query you want to use and then close the connection. You are missing only one step:
    You need to create a NpgsqlCommand and assign your query to the CommandText member, then call the command with the ExecuteReader method.
    See more | Go to post

    Leave a comment:


  • I have had this problem before tough that was a C# web service being accessed by a Java mobile phone. The end conclusion we came to was that the definition in the WSDL file was interpreted as an array as not all languages support a generic collection such as a list.

    Code:
    <xs:element name="ContactList" type="ContactOD" minOccurs="0" maxOccurs="unbounded"/>
    is therefor interpreted...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to NOT creating new .txt file
    Try using the System.IO.File. Exists method to see if the file does exist before starting the process.
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to Sorting in C#
    Sorting is based on algorithms, its not really language specific. Several of the .NET collections have sorting methods already exposed. For us to help you with a sorting algorithm you need to be more specific. What datastructure are you trying to sort? Is there any specific sorting technique you would like to use?

    Have a look at Insertion sort, Selection sort, Bubble sort and Quick sort These are all fairly well known and easy...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to c# pointers
    This is really not a question... Please read this thread on posting guidlines.

    But to answer you, If you want to use linked nodes, you are probably trying to build a linked list. The LinkedList Class is already defined in the .net library.

    Using pointers in managed code (.NET, JAVA) undermines the whole point of having managed code. Pointers can be used in C# but this is in rare cases. The pre-defined Generic Collections...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to line graph
    If you want to draw the graph manually have a look at the System.Drawing. Graphics.DrawCu rve method.

    You will need to combine your two arrays into one array of System.Drawing. Point struct.

    Check this MSDN entry for further information on the Drawing namespace should you require it.
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to WCF PerCall instance State Aware
    Have a look at the singleton approach and inversion of control this is useful when creating and managing services. A user state service might be the solution to your problem.

    Also check to see if your list/dictionary is being garbage collected, have a look at the KeepAlive method of the garbage collector. You may use this method to prevent the garbage collector from removing a reference from memory. Remember that if you have no...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to WCF PerCall instance State Aware
    What I usually do is create a server side cache to store these instances. Upon authentication I send a unique ID back to the client machine, this ID is then used upon each request to the server. Note that this ID should be more complex than just an integer for security reasons. A hash value or some sort of randomly generated string works well.

    User data is stored in a dictionary which the server uses for lookups, the unique ID being...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to format exception was unhandled"
    Create a break point and step through the code, inspect the value varialbles[0], i'm pretty sure you'll see that it is not a float, this is why you get an error, the value provided cannot be converted into a float.
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to deploying window application with .mdf
    You need to include the database along with your application, that is have it install on the client machine and reference it using a relative path eg:

    Your install folder might be as follows
    MyApp\bin\
    MyApp\bin\data

    Installing the database to the \data folder will allow you to use a relative path to the DB in your connection string

    SqlConnection con1 = new SqlConnection(" Data Source=.\\SQLEX PRESS;AttachDbF ilename=~\\data \\student.mdf;I ntegrated...
    See more | Go to post

    Leave a comment:


  • cloud255
    replied to Dynamic object creation and return?
    Well everything in .NET inherits form the object class, so you could create a base class from which all your other classes inherit and return that or define the return type as object.
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...