Psyguy's Profile User Rating: -----

Reputation: 69 Whiz
Group:
Authors
Active Posts:
312 (0.26 per day)
Joined:
12-January 11
Profile Views:
8,247
Last Active:
User is offline Feb 11 2014 03:08 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
Intel
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
250

Latest Visitors

Icon   Psyguy I reject your reality and replace it with my own...

Posts I've Made

  1. In Topic: Cannot access file "path" because its being used by another pr

    Posted 27 Dec 2013

    I believe the answer supplied here may provide some help in this situation.
  2. In Topic: Problem with how I pause a stream reader?

    Posted 27 Nov 2013

    This is how i would approach the problem:

    File Name gets entered, presumably, in code
    Load all lines of the file into a collection (list, array, queue, etc.) when the application loads up (on a separate thread if the file is large or you expect some latency issues)
    Set up timer to retrieve a line from the collection and load the line into the box as needed

    Private fileName as String = "MyFile.txt"
    Private lines as List(Of String) = New List(Of String)
    Private lineNum as Integer = 0
    
    'load the data into the private global list(or other collection)
    Using sr as new StreamReader(fileName)
         While Not sr.EndOfStream
              lines.Add(sr.ReadLine)
         End While
    End Using
    
    'in the timer tick go through a line
    'and perform what you were doing to the line
    'then increment the lineNum
    'dont forget to validate the collection size against the lineNum value
    
    
  3. In Topic: Checking to see if someone won a video game.

    Posted 27 Nov 2013

    I also happen to play LoL and I think, correct me if i am wrong, what he is trying to do is find a way of automatically verifying which team won a match where there has been a friendly wager placed on his application.

    The reason behind the application is not the important part here, however. The important part is whether the statistics and game data for a particular game can be gathered using an API or directly.

    This may help

    or this
  4. In Topic: Repetition structure

    Posted 27 Nov 2013

    Is there an error? If so, what is it? What do you mean by "not working"?
  5. In Topic: create lists from SQL Database in asp.net

    Posted 21 Nov 2013

    If you are asking what to do in your LoadPetByBreed method, here is what I would do:

            public static List<Pet> LoadPetByBreed(int drop)
            {
                var dt = new DataTable();
                //List<Pet> books = new List<Pet>();//not sure what you are doing with this
                var conn = GetConnection();
                var param = new SqlParameter("@breed", drop.ToString());//its better to parameterize, instead of text append, your filters
                var query = "select ID, Name, Species, Breed from Per where Breed = @breed";//even though you don't need breed (since you requested only one) you should completely fill the class properties
    
                try
                {
                    var sa = new SqlDataAdapter(query, conn);
    
                    sa.SelectCommand.Parameters.Add(param);
                    sa.Fill(dt);
                    //you should create a constructor in your Pet class to accept the arguments below
                    //where ItemArray[0] = ID, [1] = Name, [2] = Species, and [3] = Breed
                    var Pets = dt.AsEnumerable().Select(x=>new Pet(x.ItemArray[0], x.ItemArray[1], x.ItemArray[2], x.ItemArray[3])).ToList() ;
                    //now p holds a list of pets where the breed = whatever id drop holds
                    return Pets;
                }
                catch(Exception ex)
                {
                    //handle the exception
                    return new List<Pet>();
                }
            }
    
    

My Information

Member Title:
D.I.C Regular
Age:
36 years old
Birthday:
October 14, 1977
Gender:
Location:
Eugene, OR
Full Name:
Joel M. Priddy
Years Programming:
3
Programming Languages:
VB.NET, C#, ASP/ADO.NET, C++, Java, XML, SQL

Contact Information

E-mail:
Click here to e-mail me
LinkedIn:
http://www.linkedin.com/pub/joel-priddy/12/49/7b5/
Twitter:
joel_priddy

Friends

Comments

Page 1 of 1
  1. Photo

    sarahbanana Icon

    22 Apr 2013 - 15:20
    can you help me wtith the question i have just posted:D!
Page 1 of 1