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
P

Phillip Hodges

@Phillip Hodges
About
Posts
21
Topics
12
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • newbie: returning multiple top 30 items
    P Phillip Hodges

    Hi, I'm trying to simplify a stored procedure but have got stuck. I have a table that contains a list of 'items' and another that contains a list of 'options' associated with each 'item'. I am currently executing the stored procedure for each item one by one. Obviously this is a bad way, as it hammers the server. Is there a way to return the 30 options as 30 columns for each item/row? Hope that makes sense.. Thanks in advance, Phil Hodges

    "Rules are for the obedience of fools and the guidance of wise men"

    Database database sysadmin help question

  • Newbie: Calling an overriden method from a child class...
    P Phillip Hodges

    Thanks for the quick response... Yeah, I made a silly mistake... It is working fine now... Thanks again, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# question

  • Newbie: Calling an overriden method from a child class...
    P Phillip Hodges

    I hope that sounds right? I will explain... I have built a class (lets call it 'X') that constructs a StringBuilder and then passes it back. All is OK except within this class it calls a number of methods from a base class higher up. Here comes the tricky bit. Class 'Z' overrides a number of these base class methods, then calls 'X'. There are also several versions of 'Z' each doing similar things but with subtle differences. Question: Is there a way of calling the overridden methods in the parent class 'Z' from the child 'X'...? Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# question

  • How do I watch video from my pc on my tv
    P Phillip Hodges

    It took me an afternoon to setup... If you need any help drop me an email... http://www.xboxmediacenter.com/ http://sourceforge.net/projects/xbmc Phil phillip[at]the-hodges-family[dot]co[dot]uk

    "Rules are for the obedience of fools and the guidance of wise men"

    The Lounge question

  • How do I watch video from my pc on my tv
    P Phillip Hodges

    I use an old X-BOX with the opensource X-BOX Media Centre installed as the default dashboard... It works a treat... It pulls the media files from my server... It cost me about $30 to convert... Plus you can still use it for playing games... Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    The Lounge question

  • Newbie: How to detect if an item in a DB record is null (mysql)...
    P Phillip Hodges

    Yep I tried that but got the same error message... Will keep looking...

    "Rules are for the obedience of fools and the guidance of wise men"

    C# database question mysql help tutorial

  • Newbie: How to detect if an item in a DB record is null (mysql)...
    P Phillip Hodges

    Here is a bit of the code: // build query string mysql_query = "SELECT * FROM rt_sip WHERE id = " + id + " ORDER BY id"; // submit query mysql_reader = mysql_send_query(mysql_query); while (mysql_reader.Read()) { // extract data from record temp_id = (int)mysql_reader[0]; temp_name = (string)mysql_reader[1]; temp_accountcode = (string)mysql_reader[2]; ... ... ... } Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# database question mysql help tutorial

  • Newbie: How to detect if an item in a DB record is null (mysql)...
    P Phillip Hodges

    Hi all... Just a quick one... I am trying to pull data from a mysql database and I am falling foul of a null data error... I am querying a mysql database and pulling a record containing 38 items... However it is throwing errors because some of the items are null... What is the best way to detect if the item is null? So I can do something about it... Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# database question mysql help tutorial

  • Newbie: Programaticaly adding items to a dropdown menu?
    P Phillip Hodges

    Hello all, I am trying to add several items to a dropdown menu and have hit a brick wall. I have a list of people and I am trying to add a button for each person into the dropdown menu. But I can't get it to work. Any help or ideas? Also how do I add an event to each button so I can get it to do something when I click on it? Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# question help

  • Newbie: Stupid question about forms & variables...
    P Phillip Hodges

    This is probably a very silly question. I am opening a form(b) from within another form(a) and I am trying to get a variable from form(a) and display its contents in form(b). But I don't know how? I will also be updating the variables in form(a) from form(b)? I have searched for ideas, but not sure what to search for? Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# question

  • Newbie: Question about ListViews?
    P Phillip Hodges

    Thanks for that... Will look into it... Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# question database

  • Newbie: Question about ListViews?
    P Phillip Hodges

    I am trying to insert an item at a specific index. However it puts the new item at the end of the list. Not where it is needed. There is only one exception to this. If I switch the view to 'list' it puts the item in the correct place. Does the 'Items.Insert(5, lvitem)' command only work when in the 'list' view? If so, what is the best way of ordering items and adding items where I would like them to be put? Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# question database

  • Newbie: Porblem with ListView...
    P Phillip Hodges

    Thanks for the reply... I can insert the item. It is just not being inserted where I asked it to be... Here is the code: // Find location of original item in listview ListViewItem temp = new ListViewItem(); temp = listView_main.FindItemWithText(item_text, true, 0); int location = temp.Index; // Create listview item ListViewItem lvItem = new ListViewItem(item_text, icon); lvItem.SubItems.Add("Name:" + name + "(" + aka + ")"); lvItem.SubItems.Add("Data:" + data); lvItem.ToolTipText = item.ToString(); lvItem.Group = listView_main.Groups[0]; // Remove old item in listview listView_main.Items.RemoveAt(location); // Add new item to listview listView_main.Items.Insert(location, lvItem); Hope that helps... Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# help database question announcement

  • Newbie: Porblem with ListView...
    P Phillip Hodges

    Hello all, I am having a little trouble with a ListView. I am trying to update an item but it isn't doing what it should... To explain: I have a list containing about 20 items. I can find the index location for the item I want to update. I am then removing the old item at the found index location, and then inserting the new item at the same point. It works, but with one problem... It isn't inserting the new item at the correct index position. Instead it is putting it at the bottom of the list... And I can't work out why?? I am viewing the list in 'tile' view. Can anybody help? Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# help database question announcement

  • Newbie: Problem invoking??
    P Phillip Hodges

    Hello all, I have run into a problem... I am trying to call a method from a thread but it is throwing an exception... System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="System.Windows.Forms" Here is the code: public void zap_publish_listview(zap item) { if (listView_main.InvokeRequired) { SetZapPublishListview s = new SetZapPublishListview(zap_publish_listview); Invoke(s, new object[] { item }); } else { // Extract data from zap item int icon = getStatusIconNumber(item.zap_state.ToString()); string name = item.zap_channel.ToString(); string data = item.zap_state.ToString(); // Create listview item ListViewItem lvItem = new ListViewItem("", icon); lvItem.SubItems.Add("ZAP: " + name); lvItem.SubItems.Add(data); lvItem.ToolTipText = item.ToString(); lvItem.Group = listView_main.Groups[2]; // ZAP group is index 2 // Find location of listview item to be replaced ListViewItem old_item = listView_main.FindItemWithText("ZAP: " + name, true, 0); // If item exists if (old_item.Index >= 0) { // Insert listview item listView_main.Items.Insert(old_item.Index, lvItem); // Remove old item listView_main.Items.RemoveAt(old_item.Index); } else { // Insert listview item listView_main.Items.AddRange(new ListViewItem[] { lvItem }); } } } I have a similar method that updates a debug window... And that works fine... Can anyone help??? Thanks in advance, Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# help database debugging question

  • Newbie: Should I use an array? And how?
    P Phillip Hodges

    Will do... Thanks

    "Rules are for the obedience of fools and the guidance of wise men"

    C# data-structures help question announcement

  • Newbie: Should I use an array? And how?
    P Phillip Hodges

    I am trying to build a small application that collects data about several client applications; it also listens for triggered events and represents them graphically. I have a basic version running ok. I am storing the client info directly into a listview. However I would now like to do other 'clever' things with the collected client info. I was planning to store the data in an array. The problem I have run into is that I do not know the size the array will need to be until I have started to populate it with data. Is there a way to dynamically add data to an array? Or is there another way of storing the client info (so it can be processed and have things done to it)? Thanks in advance... Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# data-structures help question announcement

  • Newbie: The best way to detect the end of a data stream...
    P Phillip Hodges

    Hello all.. I am trying to construct a way of extracting data from a network stream. However I am running into a small problem. I am using regex to detect a pair of return & newlines "\r\n\r\n". However some of the messages received have "\r\n\r\n" in the middle of the stream. So some of the messages are cut off halfway. byte[] ami_response_buffer = new byte[ami_buffer_size]; MemoryStream ami_memory_stream = new MemoryStream(); string ami_response = ""; int ami_bytes_read = 0; do { ami_bytes_read = ami_client_stream.Read(ami_response_buffer, 0, ami_buffer_size); ami_memory_stream.Write(ami_response_buffer, 0, ami_bytes_read); ami_response = Encoding.ASCII.GetString(ami_memory_stream.GetBuffer()); // Check for end of message if (Regex.Match(ami_response, "\r\n\r\n", RegexOptions.IgnoreCase).Success) { ami_bytes_read = 0; } } while (ami_bytes_read > 0); return ami_response; What is the best way to detect the end of a data stream? Thanks in advance... Phil

    "Rules are for the obedience of fools and the guidance of wise men"

    C# regex question sysadmin help

  • Newbie: How to find out which menu item has been clicked from a context menu?
    P Phillip Hodges

    Thanks for the quick reply... Great stuff... Phil:-D

    C# question database com tools help

  • Newbie: How to find out which menu item has been clicked from a context menu?
    P Phillip Hodges

    This is a follow on question from: http://www.codeproject.com/script/comments/forums.asp?forumid=1649&XtraIDs=1649&searchkw=hodges&sd=5%2F16%2F2006&ed=8%2F14%2F2006&select=1619517&df=100&noise=5&mpp=50&fr=319#xx1619517xx I have been able to populate a context menu with data from a database. However I now have the problem of working out which item has been selected from the menu. This is the code that adds the items to the menu: private void addPersonalPhonebookItem(string name, string number) { ToolStripMenuItem personal = ts_phonebook_personal; ToolStripMenuItem personalMenuItem = new ToolStripMenuItem(); personalMenuItem.Name = name; personalMenuItem.Text = name + " (" + number + ")"; personalMenuItem.Click +=new EventHandler(phonebookMenuItem_Click); personalMenuItem.Tag = name + number; personal.DropDown.Items.Add(personalMenuItem); } And this is the EventHandler: void phonebookMenuItem_Click(object sender, EventArgs e) { MessageBox.Show("You Just Clicked: " + e.ToString()); } How do I get the 'name' or 'number' of the clicked item... Thanks again in advance, Phil

    C# question database com tools help
  • Login

  • Don't have an account? Register

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