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
C

crash893

@crash893
About
Posts
110
Topics
33
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • XML Reading question.
    C crash893

    I'm not sure i follow

    C# question help regex xml tutorial

  • XML Reading question.
    C crash893

    my cup runith over Like i said in my orginal post this is my first time working with XML at all let alone in c# I got the xml reader part thats how i am able to get the atrubut value. however when you create a new attrubute you give it a Name AND a value i can read the value of the attrubute but i can not figure out how to get the orginal name ( in this case the textboxs name) I have no idea what you implying with the use xmlnode

    C# question help regex xml tutorial

  • XML Reading question.
    C crash893

    Hi all, I started my first xml writeing /reading project I want to save all the text in the textboxes of the form to an xml file ( save file) and then load it back later. I have the writing XML down ( i think please let me know if you have ideas) but here is an example of my output

    ?xml version="1.0" encoding="UTF-8"?
    Root
    FileInfo
    Region Region="Region1" /
    TourName TourName="mens2006" /
    Username Username="rbarbrow" /
    timestamp TimeStamp="9/2/2008 1:25:26 AM" /
    /FileInfo
    MatchInfo
    Match TB_32_C="No Chatter" /
    Match TB_32_U="1-North Carolina (32-2)" /
    Match TB_32_L="16- Play-In-Winner" /
    Match TB_32_S="Raliegh, N.C., Friday 7:10" /
    Match TB_33_C="No Chatter" />
    Match TB_33_U="8-Indiana (25-7)" /
    Match TB_33_L="9-Arkansas (22-11)" /
    Match TB_33_S="Ralegh, N.C., Friday, 9:30" /
    /MatchInfo>
    /Root

    The idea is that i have textboxes TB_##_(U,S,L,C) and that i can read what textbox and what text and then read the text back in the problem is that i can read the text with the .getattribute(i) method ("no chatter" or "1-North Carolina (32-2)") but i can not read the attribute name ( TB_32_C or TB_32_U) So question 1 is: How do i read the Attribute NAME? question 2 is there a way to read only things in the MatchInfo Node? ( if node is the right word) Thanks so much for any help

    C# question help regex xml tutorial

  • bindingsource.filter syntax question
    C crash893

    I've done some looking around and I'm a bit confused Here is an example of the data that's in the binding source [IMG]http://i38.tinypic.com/xfoimp.png\[/IMG\] what i want to do is sort on the 3rd row ( 4 or 3) and then sort by the date ( to see if the record is before a certian time my idea to do this was to filter the BS BS.count then unfiltered the BS The problem i keep running into is that i cant say that i want Just 4 or Just 3 What I've come up with so far is

    private int deadlineCount(DateTime Time, int LeagueID)
    {
    int total = 0;
    string league;
    if (LeagueID == 99)
    {
    league = "";
    }
    else
    {
    league = LeagueID.ToString();
    }

            BS.Filter = string.Format("LeagueID >= '{0}' and LeagueID <= '{0}'and \[End\] <#12/30/1899 {1}#", league, Time.ToString("h:mm tt"));
            total = BS.Count;
            BS.Filter = "";
            
            return total;
        
        }
    

    But i keep running into problems that i cant use any operator ( like ,> ,= ,>=,) becuase it can not preform X onn system.int32 and system.string. I've been looking around but all the example seem to be for strings or dates.

    C# wpf wcf com help tutorial

  • define crop from picturebox?
    C crash893

    Hey all, I need to load a photo, Display it in a picturebox then "draw" a rectangle area that i want to crop an example would be if i wanted to make a head shot out of a regular photo i know how to find and load the photo in to the picture box but I'm not sure how to define the crop i want any ideas

    C# tutorial question

  • Problem with returning a string from a sub
    C crash893

    Thanks for all your help I really appreciate the string.isnullorempty(temp) In are application it doesn't matter because we are joining together .csv files but if you were to use it for say a text file or something if there was a empty space it would stop at the dump out of the loop. again I really appreciate it thanks

    C# help

  • Problem with returning a string from a sub
    C crash893

    Hi all I have a sub that writes to a textbox in the code. I want to change it so it just returns as a string so i can use it over again for other stuff in the program the current code is this private void Readlog(string path) { StreamReader SR; string S; SR = File.OpenText(path); S = SR.ReadLine(); while (S != null) { if (S != null) { //this is sloppy but i cant have a trailing /r/n so this is the only //way i can think to get rid of it S = S + "\r\n"; } textBox1.AppendText(S); S = SR.ReadLine(); } SR.Close(); } what i want to do is change it to something like private string Readlog(string path) { string temp; StreamReader SR; string S ; SR = File.OpenText(path); S = SR.ReadLine(); temp =s while (S != null) { if (S != null) { S = S + "\r\n"; } temp = temp +S; S = SR.ReadLine(); } SR.Close(); return temp; } The problem is that it always returns a null or just one line of text and i know its probably somthing right in front of me but I can't seem to figure out what it is the idea is that i can use it in something like textbox1.text = readlog(c:\test) or Foreach something in something { writelog(merge.txt,readlog(something.filename); } Thanks for pointing me in the right direction

    C# help

  • sorted list question
    C crash893

    Someone else suggested this solution

    private SortedList getTotals(BindingSource BS, string column)
    {
    SortedList list = new SortedList();
    string name;

            foreach (DataRowView row in BS)
            {
                name = (string)row\[column\];
    
                if (list.ContainsKey(name))
                {
                    list\[name\]++;
                }
                else
                {
                    list.Add(name, 1);
                }
            }
            return list;
        }
    

    Side thought is there an easy way to "strip" the key values into an array that i could feed a combobox?

    C# question help wpf wcf

  • sorted list question
    C crash893

    that works great I just tried it thanks so much I was close but I don't think I would have gotten that for a while

    C# question help wpf wcf

  • sorted list question
    C crash893

    I'll give it a try sorry about the tags I always forget going from form to form this one is a little different

    C# question help wpf wcf

  • sorted list question
    C crash893

    Hi all I'm totaling up a list of items in a Binding source and I am just having a small problem with syntax for incrementing the value of a key if it already exists any help is greatly appreciated line 16 below [code]SortedList mySortedList = new SortedList(); foreach (DataRowView view in myBindingSource) { if ((string)view["group_name"] == "USAT-Desktop") { view["group_name"] = "TEST TEST"; } if (mySortedList.Contains(view["category_name"])== false) { mySortedList.Add(view["category_name"], 1); } else { //how do I ++ the value of the key if it already exists? //mysortedlist[view["category_name"]].value +=1? }[/code]

    C# question help wpf wcf

  • sub total a bindingsource with an array
    C crash893

    anyone?

    C# data-structures question

  • sub total a bindingsource with an array
    C crash893

    I thought about using the count feature in a query but the data is filtered at the binding source by the user and it would be "to hard" to run sql querys allot on the server that has this info. so i basically take one huge dataset add it to a binding source then filter it from there (what ever the user wants to see) then the idea is that they hit a button and it produces an array that goes into a graphing class and out pops a beautiful bar graph. usatoday I'm in IT but I'm not a programmer I'm just doing this for the fun / self education. I have so far something like (this is quasi sudo code) foreach (DataRowView view in myBindingSource) { If ( array.find((string)view["cat_name"] != 1) { array.add((string)view["cat_name"] ,1) // the ,1 is the total feild so im having some trouble with that } else "find index of catname and add +1 to the total" } return array

    C# data-structures question

  • sub total a bindingsource with an array
    C crash893

    its not for a class its for something at work we have a db of incidents or tickets and each ticket has a type for example: Microsoft word or outlook or account lockout I make reports for my boss each month on how many of each we had but I am currently using excel for this which sucks so I'm trying to automate it ( or at least make an app he can run himself) I currently have it so that i can download it into a datagridview and filter it using bindingsource.filter but to graph it for him i would like to get totals and i also need to consolidate the names so that i can auto populate some of the combo boxes I just didnt know if there was a better way to "link" the cells in the array so that if I found bob I could +1 the bob total with out it getting misaligned

    C# data-structures question

  • sub total a bindingsource with an array
    C crash893

    I need to set up an array would look something like this but I'm not sure what type basicly i have a list of occrences lets say bob rob bob joe bob joe joe rob jay jay jay rob jay jay jay rob rob joe jay jay jay and from that I would have to "sub total" the list into something like this name count bob 3 rob 5 joe 4 jay 9 1) what type of array would this be 2) how would i prevent it from adding duplicate names?

    C# data-structures question

  • data through multi forms
    C crash893

    could you give me a simple example

    C# database question help tutorial

  • data through multi forms
    C crash893

    hi all I am making a second form to help the user enter info that will go into a sql query I have seen many examples to pass info TO a new form but i haven't really seen anything about how to pass the info back. I am currently using a public string hold the info in form1 but it seems to me that there must be a better way to pass the info back something more like a return or something like that My other question is that is there anyway i can triger an event when form2 closes?

    C# database question help tutorial

  • loop through a bindingsource
    C crash893

    test or manipulate messagebox.show(something.tostring()) i am also trying to figure out how to do something like if something.tostring() containes stringtext { replace something.tostring with stringreplace }

    C# wpf wcf help tutorial question

  • loop through a bindingsource
    C crash893

    does anyone know how to loop through a binding source? so far i have been working with the code foreach (DataRowView invoiceRow in invoicebindingsource) { } but what if i only want to check one column? I am also a little unclear on how to address that info in the cell i am currently looking at Thanks for any help you can give

    C# wpf wcf help tutorial question

  • format filter and total a bindingsource
    C crash893

    Hi all I am reading a DB into a binding source that I am then displaying in a datagridview I want to do a few things like go through and format a few rows (example: companyname/username to just display the user name) i also want to get a count on of how many of each type in a certain column lastly i know i can use the .filter to the binding source but i have two questions i need clarified 1a) how do you string more than one filter together. 2a) if i use the filter and then i ran a counting loop or something in the binding source would it give me the account for all the info in the binding source or would it give me the totals for the filtered info. Thanks

    C# database wpf wcf tutorial
  • Login

  • Don't have an account? Register

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