I'm not sure i follow
crash893
Posts
-
XML Reading question. -
XML Reading question.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
-
XML Reading question.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>
/RootThe 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
-
bindingsource.filter syntax questionI'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.
-
define crop from picturebox?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
-
Problem with returning a string from a subThanks 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
-
Problem with returning a string from a subHi 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 likeprivate 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) orForeach something in something { writelog(merge.txt,readlog(something.filename); }
Thanks for pointing me in the right direction -
sorted list questionSomeone 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?
-
sorted list questionthat 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
-
sorted list questionI'll give it a try sorry about the tags I always forget going from form to form this one is a little different
-
sorted list questionHi 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]
-
sub total a bindingsource with an arrayanyone?
-
sub total a bindingsource with an arrayI 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
-
sub total a bindingsource with an arrayits 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
-
sub total a bindingsource with an arrayI 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?
-
data through multi formscould you give me a simple example
-
data through multi formshi 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?
-
loop through a bindingsourcetest 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 }
-
loop through a bindingsourcedoes 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
-
format filter and total a bindingsourceHi 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