Jump to content
Xtreme .Net Talk

Denaes

Avatar/Signature
  • Posts

    975
  • Joined

  • Last visited

Everything posted by Denaes

  1. If the information is in a mySQL database, you need to connect to it. There isn't a way around that. You just do a simple query: "SELECT * FROM <table> ORDER by <Ranking Field>" and you'll be returned a datatable with all the records on said table in order from 1 to 5 (or whatever). Many things you can do to change the query. In general, thats one of the benefits of using a database is that you can do a lot of data manipulation (reordering, filtering, figured fields) on the query and just worry about the data you're given. True, .Net has classes that help you filter and sort datatables (and bindingsources in 2005). If the data is in a mySQL database: Connect, use your querry to grab data into a datatable and use the data. Thats the easiest way. You can create a custom class to act like a datatable or datarow (a record) if you want. Thats up to you. I think the .net dataset/datatable/datarows are good for the job, though I'm often not terribly hot about using a datarow on a typed datatable... I always end up fumbling it for a while before getting it right.
  2. mySQL databases are pretty fast. Are you connecting over the internet and grabbing individual records or something? Anywho... There isn't much to it once you have a connection. Create a class with properties (the database fields you want), query the record you want and put the information in the class variable. If you want a bunch of names, make a collection/array of that variable. Honestly the easiest thing to do would be to query information from the database and put it in a datatable/dataset if you're getting more than one record.
  3. 1. In Visual Basic.net, when you add a typed dataset, binding source and Table Adaptors to your project (they're added automatically as a package when you add various tables), I have no problems with the fact that new controls are created for these objects. Pretty nice. But the instances that are automatically added to the form are really not named what I want: UsersBindingSource, UsersBindingTable, UsersBindingNavigator. then the automatically databound controls: FirstNameTextbox, isDeadCheckbox, etc. This just bothers me to no end. I know MS likes to have a new naming convention where you don't use prefixes, but I think thats silly. Even if you don't go with prefixes, why would you want the entire name of the control after the name? It takes up a lot of space in that box below your form in design time. It's also not intuitive in the least. I (and most people in the english speaking community) read from left to right. I like to see what something is right there. I don't want to have to read halfway into a variable name to find out if it's the BindingSource, TableAdaptor or BindingNavigator. With intellisense, all of your controls would just be all over the place. I like typing bs and seeing all my BindingSources. txt gives me all of my textboxes. It's easy and groups things together. I'm sure this is a template somewhere where you can change the default from "Name = Name + Control" to "Name = Control + Name" or better yet: "Name = preferredSyntax + Name". 2. While I'm thinking about it, if there is a file(s) I could change the default naming convention on normal controls, I would. Textbox1, Textbox2, Textbox3. I could do just fine with txt1, txt2, txt3. lbl, cbo, chk, etc. I'm not sure if it's really much quicker, but it just seems more convenient if you're using naming conventions. 3. Split files. I want to get rid of them. I'm not saying I'll never want to make use of them. I just don't want VS to make it happen automatically. One of the selling points of .Net was that all the code was in one file. Nothing was hidden from you. I understand that they had to cripple things to make more VB6ers want to come over, but I very much hope this is an option and not mandatory. I've been hardcore using 2005 for about a week at work and I've been tripped up by these split files about a dozen times. in the time I've been using 2003 I've never once said "I wish this were hidden or in another file". I said "I'm greatful that I can view and get to all the code I need if I wish, but it's in a closed region. How great, the best of both worlds!" ********************************************************* I'm sure more things will come up. Really it would be great if these were settings. I know there is a way to setup code generation. Thats like when you type in a property and VS gives you the skeleton to fill in. You can create your own. Not sure how yet, but thats smooth.
  4. If I recall correctly, when you open a file in this fashion, the filename is a parameter. I remember doing something like this with context menus. I had it where I would get a different menu depending on which file type I clicked on and what was highlighted. Edit: http://www.xtremedotnettalk.com/showthread.php?t=87467&highlight=context This is the thread I have on it. I'm a bit fuzzy on the specific details as this was a long time ago, but I hope this helps
  5. Ok, I have a fast update. The myBase thing didn't work at all. It went to the base of the customcontrol and disabled all controls on it. Duh, I should have guessed that. I'd have to pass in an instance of the form to get at it's ControlCollection... But thats not what I'm ultimately going for anyways. I created a collection in my control and a writeonly property that is of Control type. It adds it to the collection. That works and I can then enable/disable those controls as I wish. It really just means that I have to associate which controls will be ruled by my control on form load. I'll probobly also have quite a few properties/functions to get a list of controls in each collection (the name of each control is it's key) and ways to remove controls as well. This looks like it's what I'm looking for. Of course if anyone has any advice, chime in :)
  6. Effecting other controls on a form from within a compiled control This is something I really want to learn more about. Say I made a control and it does many nice things that are useful. One thing is to press the "Disable" button and disable (enable = False) every other control on a form. Now preferably I just want to drag this control onto a form and be able to click the button and everything is disabled. I'm pretty sure I can do this easily. Just do a myBase.ControlCollection "for each control..." and make sure I'm not disabling the control doing this. This would work right? Well where I want to take it is to be able to choose certain controls to subscribe to this controlcollection rather than just disable everything. Primarily this is a control to help manage database front end functionality. When I do an "Edit", I want to disable all the navigation controls, but enable all of the databound controls. part of the problem (why I'm not just doing a search for databound controls) is that other databound controls are the opposite (like some listboxes & comboboxes) and are used for navigation and should be disabled for Edit/add. The optimal solution is a way to just drop the control and go. I don't think that'll happen. I think the best I'll get is exposing properties to add controls to specific collections and have (at least) two controlcollection: 1 to disable on Add/Edit and enable on View and another to enable on Add/Edit and disable on View. If anyone has similar ideas that would work, I'm definately all ears. I would have just tested this all out, but I'm not able to get to VS for a while. I'll post when I do get some testing done.
  7. Here is an update on my situation: I have everything databound 100%. Everything is relational and I don't need to do a lick of code for that. The BindingNavigator has buttons (and specific methods) on it for adding new records and deleting records and nothing for editing a record. From what I gather, you need to manually use the endEdit on the bindingsource to save an Edit/update. Just sort of annoying. Now, I have a typed relational dataset based off of my MSQL database. The ColumnChanged is an Event for a Datatable and isn't available for a Dataset. I'm not sure how I could get at the datatable's events as the VS2005 event manager and directly by code doesn't allow that. So currently I have the changes being made to other controls when the contents of a particular combobox is changed. This is because the combobox is changed on both the user changing it and when the datarow is changed via the BindingNavigator
  8. Any good? I'm running on Team Edition b2 (we were sent team edition and team server, but no normal b2 dvds in our MSDN package??) and it's workable stable. It slows down at some points and does a good job about creating code for a control/component, then changing all instances of the name to match the change... but sometimes wigs and corrupts or changes half the names causing a lot of errors (on the error list, not VS runtime errors). More than once I've had to delete all my datacomponents to get the form working again, then adding and renaming (because I'm anal about how they're named). Of course I should add that I'm using the VB.net portion. I havn't used the C# portion yet. The release date on my version is like 5/1/2005. The release date on RC1 is 9/12/2005. A few months in between. Any neat improvements? Much more stable? -- Edit Will RC1 be released with the MSDN this month? We don't have a DVD burner here at work. I'm sure we could decompress the ISO somehow, but if we're going to get the DVD it's not worth the effort.
  9. The BindingSource position changes will be triggered by at least two different controls, a listbox of sorts to choose by name/id or something and a toolbar with standard navigation tools (next, prev, first, last, type in index). What some comboboxes do (not all mind you) is modify other comboboxes, textboxes, etc. For example, the easy one I was working with is a ComboBox with two choices: Social Security Number and Employer ID. If you choose SSN, the mask for the textbox next to it changes to "000-00-0000" and if you choose Employer ID, the mask for the textbox becomes: "00-0000000". So just for this one case, you'll need to catch things when the combobox is changed by the user and when it's changed by the BindingSource on a record change. Also since the combobox the displaying SSN & EmpID choices isn't how it's displayed in the datatable (displayed S & E respectivly) I'll need a bit of code or link the choices somehow automatically. The later seems possible with how automated these binding sources are, but I havn't been able to link them properly yet. So I might need to select the index on each record change manually (grumble grumble). I want everything related from a database done automatically, but I can't figure it all out yet. But thats another topic. Yes, I will have a few of these gems, where what you choose filters (or requerries) another control. That does look very promising hitting up the dataset's columnchanged event... I'll look into that. Does it fire whenever you change a row and the value is different or just whenever the column is specifically changed in the dataset? Exactly what I'm going for. I mean I want everything as automated and with as little code as possible. Just getting the hang of the new stuff they have in this 2005. I mean really, a lot of changes to ADO.Net. I think it's for the better. It seems a lot easier than I recall 2003 being. Thank you for the advice. I'm going to check up on the RowChanged event and also a bit more into the BindingSource.
  10. I've used this in the past, only in reverse setting the bool to true when done, but same principle. It's the messy solution I was hoping to avoid. These second two were what I was hoping existed. They'll work for the comboboxes just fine and are a bit cleaner than having to create and set a variable. Doesn't seem like it would work for the BindingSource as you don't give it focus. But I'm sure I could find a similar check for changing rows... probobly the navigation control. Thanks much :)
  11. No, 2005 does the loading automatically. You just choose which bindingsource is distributing the information and link each control to it. I even went into the form designer and there is no generated code with BeginUpdate or EndUpdate.
  12. I've done two apps I'm proud of. One was an application that would open up an application, read keystrokes from an XML file and send keys to the various fields in the application. It doesn't seem like much and isn't a lot of code, but took me a week or three researching all the techniques and whatnot. It was basically used to run applications on a timed basis in the middle of the night. Now I'm proud of it, but it's clownshoes compared to applications like AutoHotKey which I could have done this in like 20 minutes (learning curve included). The other was a scheduling application. Took me forever to complete as the people who had contracted me kept changing the specs on fundamental levels... I feel like redoing it for myself someday with the features I want and customizable like I want it.
  13. This is dead easy with a database. Just select one field to be an Item and another (normally the unique key ID in my experience, but not always) to be the ValueMember. Is there a way to configure this relationship manually?
  14. Ok, I'm loading some values into a combobox (and other controls) and I have a SelectedIndexChanged event for this combobox. Now, in the event I need to evaluate either the Value or the Text. Now what happens is that the SelectedIndexChanged event fires multiple times while the form loads and the data is fed into the combobox from the datasource. Before there are any items fed into the combobox, the Text and value are Null, which causes errors on trying to evaluate. I have two solutions to this problem: 1. Try statements around anything reading from the combobox. 2. Set a variable like isLoaded which is set to false and made true after the formLoad event is finished or the database is finished loading. The first solution looks like a huge waste. I'm not sure how much wasted resources go into a Try statement, but doing it with every control seems kind of silly. Maybe thats the best way to go. The second solution looks really silly. Performance wise, checking for a true value shouldn't be hard, but it seems rather messy to go throwing around this variable and making all these checks (there are other controls with the same problem) As well, I get this problem with the RecordChanged event for the BindingSources as well. Again a Try statement might be the correct way to go on this. Are there any other solutions to this problem?
  15. At work I'm doing .Net. I'm in the begining stages of converting a legacy database product over to VB.Net 2005. Aside from not really touching .Net for a few months, working in 2005 is really humbling. ADO.Net has really changed. I think it's for the better, it's so much easier than I remember it... though it's still different. It's sort of frustrating all the bugs I get between Visual Studio 2005 (far and away mostly display corruptions) and SQL CTP 2005 (the damned thing won't install with the same options on any two computers!). But I have SQL CTP 2005 basically running on my machine enough to serve a database (no extra features) and VS2005 can do some of the basic SQL Server functions. But with how soon 2005 is comming out it would have been silly to go forward with 2003 and then convert again. In fact I'm just hoping they don't change things I'm learning for the final release. I'd think that beta2 means that most of the functionality is there, just needing to fill out error handling and catching bugs and whatnot.
  16. I second the "do it yourself". Component One had a free version of their suite like 2 years back with the VB.Net addon pack. It was a commercially free pack which was pretty good and had reporting tools and flexgrids. It's nothing compared to the newest C1 package... that thing is just awesome. But I used the C1 Reporting to create reports. It comes with a report builder which works suprisingly like a less polished version of the MS Access report builder... it was kinda quick 'n dirty. But it did work. Then you could view the code and change things or add things. For the application I had, I had a window that scanned a directory for reports (they were .xml files) and displayed the names and I had about 10-15 reports. Pros: nobody needs to have anything other than .Net. It's how you want it to look. It's pretty easy. Great documentation. Cons: You have to be careful about displaying your text. If you don't have a unicode font 5 characters will take up different space: "iiiii" vs "WWWWW" and it's easy to get lines truncated or running over each other. Using Word would require someone to have word, but would handle some of these problems and (IMO) wouldn't look as professional. Overall, if you're doing this for someone else's utility, I'd say do it as a Report and as a .RTF or .Doc both. It gives someone a chance to manipulate the data. Where I currently work, 99% of the reports are Excel & Report. The report exports to PDF.
  17. Learn something new every day. Firefox and Visual Studio just got a little nicer :D
  18. I'm a ComponentOne user in general (ever since that free deal with microsoft a while back). The company I work for uses Progress currently, but is starting to migrate to VB.Net and it looks like they're interested in ComponentOne and Infragistics, so I'll see how it is. Some of these controls they have are pretty damned amazing - especially considering .Net turned their backs on business developers by getting rid of the flexgrid, it's amazing how advanced these flexgrid controls are :D
  19. Longhorn in some form has been available for the last 4 months I've had MSDN. I'm sure it's buggy as hell and I only have one PC, which is my production PC. So I havn't had a chance to install it. I really don't have much interest in IE7. Firefox is a superior browswer and at best all I see is MS copying some of the great features of firefox which would then put it in the category of "not sucking too bad". Honestly one of the help documentation browsers that Microsoft had even allowed tabbed browsing. Of course the theory was tabbed help documents, but you could surf the web with it. I'll look into installing IE7 this weekend, but I have pretty low expectations for it.
  20. Oh... Sorry. Thought I mentioned. Progress 9 4GL. The people at work compare the syntax to VB6 (which is why I got the job which I'm not ungrateful for) and they also compare it as a database application akin to Oracle. I pray for peoples souls that it's not really like Oracle. Oracle has to have more redeeming values and speed and ease of use... To cut down on length of size for a procedure they use "include files" (similar to PHP, JavaScript and HTML) which is just another file which at runtime is inserted dynamically into the proceedure. :eek: No. No. That proceedure I was working on was way more than 500 lines! I forgot that there was an include for populating the databables... probobly like 300 lines, and they use includes for the graphical report page creations in a way that it's effectively calling another 50 lines to the procedure each time a new page is printed. Well anyways, the proceedure I saw and worked with was a grand 500 lines of no region folding straight up code. And they look at me like I"m crazy when I use jEdit for it's Folding, inserting Todo lists, code anchors, etc. :rolleyes:
  21. Yes you can shoot me. I'm at work converting reports from ASCII Display over to a Reporting Module for more professional display. 500 lines of code with maybe 20 of them being comments - 10 of that being the Header which doesn't really say anything. Oh, and whoever wrote this procedure didn't even tab properly so indents are all over the place. This is a single procedure set up to handle 3 variations of the same report and various sorting methods. I just know this could be handled better through use of procedures and/or classes. Damn I miss programming in .net
  22. OK, I ditched Eclipse soon. All the code folding was specifically written for Java and you couldn't customize it. You had to write a whole plugin with logic statements of the language to get it to work with a langauge I found this nice little guy called: CodeBrowser. It has code folding and code linking and it's easy to add a language on. The longest part was copying over the index of Progresses 800 key terms, many of which had shortcut key terms (!?) and having to edit out the description of them. Just as a comparison, VB6 had a ton of keywords. VB.net & C# (ie, .net) has something like 50. Because it has a framework of classes rather than individual keywords.
  23. I found that Eclipse has some plugins that do the Regions. I'm not sure about the includes though. I'm sure there is something. Thats a common PHP/Javascript thing. I don't know if PHP/JS programmers are annoyed by it, but I am. Then again they may have a more organized development team :rolleyes:
  24. Sorry, I don't have 2003 installed at the moment, only 2005. For a debug, you can target another application instead of opening the one you're working on and send it command lines. So you could target Mono or 1.0/1.1 just fine. For a compile (not debug) you have the option of adding Build Events which run macros under certain conditions. This too could target another command line compiler. You would be getting 2005 intellisense and code warnings/errors, but you could target other frameworks. Does 2003 have the same options for compile? If so you can target the other frameworks on a build.
×
×
  • Create New...