Jump to content
Xtreme .Net Talk

kasdoffe

Avatar/Signature
  • Posts

    57
  • Joined

  • Last visited

kasdoffe's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. No, I'm not reading it from a file. I'm reading it from a socket. The socket sends up a bunch of data, some of it's xml, some of it's not. Take a look at my second string example in my original post.
  2. How can I easily parse a string like the following? <First>John</First><Last>Doe</Last><MiddleInitial>J</MiddleInitial> If I want to extract the last name 'Doe' from that string, is there an xml command to do so? I hope I wouldn't have to use string manipulation to find the location and parse the text. Changing the format of the string to parse isn't an option. In fact, it could be even more messed up, like this: 156^first:1:3^last:2:4^<First>John</First><Last>Doe</Last><MiddleInitial>J</MiddleInitial>^blahblahblah Any help?
  3. I want to add a submenu to my programs context menu that will then show the standard Window's Explorer submenu. Any ideas? If anyone has ever used the program Tortoise CVS, it does such a thing. When you choose to Commit a set of files, right clicking on a file in the list displays the CVS menus, but there's also a submenu called Explorer. Highlighting this menu then displays a submenu just like you were in Window's Explorer and right clicked the file there. help please..
  4. bump? Any help at all? To test it, just use the exact code I'm using on a button click or something. It's screwy!
  5. Help me with this sample code: // create dataset and datatable DataSet myDataSet = new DataSet("myDataSet"); DataTable myDataTable = new DataTable("myDataTable"); // add column to table myDataTable.Columns.Add(new DataColumn("c1",typeof(int))); // create datarow array of 3 rows DataRow [] dra = new DataRow[3]; // setup row 1 dra[0] = myDataTable.NewRow(); dra[0][0]=0; // setup row 2 dra[1] = myDataTable.NewRow(); dra[1][0]=1; // setup row 3 dra[2] = myDataTable.NewRow(); dra[2][0]=2; // merge rows into dataset myDataSet.Merge(dra,true,MissingSchemaAction.Add); // accept changes myDataSet.AcceptChanges(); // write row count System.Diagnostics.Debug.WriteLine(myDataSet.Tables[0].Rows.Count.ToString()); [/Code] When this is all finished, row count is still 0. How do I merge rows into a dataset without actually adding them to a table and merging the table into the dataset? Using a performance profiler software, I've found that looping and adding 5000 rows to a table takes quite a while to do. I assumed, 'Hey, i'm sure there's a way to add a bunch of rows at once, wonder how long that takes?' I was hoping there was something like DataTable.AddRange, but you can only add 1 row at a time to a table. Any ideas? Please tell me what's wrong with my code though...
  6. How do i get the window handle of the window that just had focus. When my program activates or gets focus while running, I want to know what the window handle is of the previous window. For instance, I start my program and start Internet Explorer. I focus my program, focus IE, then focus my program. How can I get the window handle of IE in this instance? Or any other instance, how do I get that handle of the previously focused window?
  7. Is there a way to execute a command window app and redirect the output as it's being outputted? (sp). For instance, I start a command window exe using Process.Start(). This exe spits out text to the command window screen for 30-45 seconds. I want to catch those lines and display them in my Windows Form app as they're being generated. Waiting 45 seconds to do Process.StandardOutput.ReadToEnd() doesn't help.. Any help? I'm using C#.
  8. I have an UnhandledExceptionHandler and ThreadException handler wrapped around my main form in the Main method. However, I can reproduce an error that doesn't get caught by these 2 handlers. What gives? What would cause these 2 'Catch-All' handlers from not catching a System.NullReferenceException? PS. I've read that these handlers are 'Catch-All' handlers. I'm not so sure now.
  9. I'm trying to get the Active Title Bar colors from my system settings in code. I see the active title bar color the SystemColors collection but I can't find the 2nd color that creates the gradient. Any help?
  10. I want to use the select command on my datatable to select a subset of rows that match my criteria. However, I'm having trouble. Here's my code: DataRow [] dra = myDataSet.Tables["Tasks"].Select(select); select = (DueDate>Format('1/1/1','yyyy/MM/dd') And Due_Date<Now() And Completed=False) Or (Completed=False) I get the following error message though: "The expression contains undefined function call Format()." How can I check if my DueDate column is set to the default 1/1/1? help please?
  11. I figured it out, myTable.Select("column0 like '%[*]'") returns the rows i need!
  12. I want to execute a SQL command using the DataTable.Select command on my datatable. Problem is my column contains data that contains asterisks (*). I want to select all data that contains an asterisk (*). My current command looks like: myTable.Select("column0 like '%*'") but this returns all rows when it should only return the single row that actually meets my requirements. So, I tested. 1. myTable.Select("column0 like '*'") returns all rows. (didn't know that) 2. myTable.Select("column0 like '%'") returns all rows. (Yes, i knew that) 3. myTable.Select(@"column0 like '%\*'") returns nothing. 4. myTable.Select(@"column0 like '%/'*") returns nothing. I think I need some escape character before the asterisk. Any help? btw, i'm using C#.
×
×
  • Create New...