Jump to content
Xtreme .Net Talk

mocella

Avatar/Signature
  • Posts

    278
  • Joined

  • Last visited

Everything posted by mocella

  1. You can define a 4th project that has these shared variables defined within, reference this project from the other three, and have your UI create the initial instance of this 4th project, and let it live in your main form. When you instantiate/call your BLL or DAL, pass the instance of the 4th project (by-reference) and these other layers can now use the shared variables. There's other ways of doing this, this is just the first/easiest way that came to mind at 6:45am. ;)
  2. One quick solution is to change the definitions of your Form2 UI components from "private" to "protected internal" in scope - then you can get at them from Form1. Otherwise, you can set up properties in Form2 that just return the appropriate values from the fields you want Form1 to see.
  3. You can use one the VS.Net built-in "Setup and Deployment" projects to do this and create an MSI/Setup file for your code.
  4. If you're on the same network (I'm assuming this is the case), you can try something like this example shows: http://zamov.online.fr/EXHTML/CSharp/CSharp_772553.html (I haven't tried this, but we have similar utility we use to accomplish the same)
  5. Look into the Configuration Management Application Blocks: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/cmab.asp While you may not make use of all the functionality, you can pick and chose and not reinvent the wheel on this.
  6. If you use C#, you can use summary tags. Above each of your functions, just type "///" and it'll fill in the XML tags and you just need to fill in the blanks. Here's what it'll look like: /// <summary> /// This function will set the tool-bar and menu-items to the appropriate /// enabled state based upon the value of isAvailable /// </summary> /// <param name="isAvailable">specifies if we want to enable conrols</param> public void SetUserOptionsAvailable( bool isAvailable ) { } So now, when someone is trying to use that function, they'll see your explanations in the intellisense.
  7. You could create a trigger that updates your Questions table when the Posts table gets a record added. You could also just have a stored proc that first inserts your Post, then proceeds to update your Question record related to the Post. There's a few ways you can approach this and all will work just fine. Depends on how much code you want to write and how much authority you have on the SQL Server.
  8. 70-300 is the last test I took in the MSCD.net series, and it was by far the hardest to pass, mostly due to the rather subjective nature of the questions/answers. I couldn't even imagine trying 70-300 without completing the other tests so you have a good understanding of how they ask questions and what the key concepts are (which is a good clue to how the 70-300 questions are answered).
  9. I was at MSDN last week and also saw some of the new features. I'm also quite excited about built-in refactoring. The "My" namespace and ready-to-use code-snippets in VB were also pretty interesting additions to the suite. We also got a sneak-peek at SQL Yukon (is that what they're still calling it?), and there was definitely some mixed reactions to the new dll stored procedures - where you write the "stored procedure" in Visual Studio then deploy that dll to the SQL Server.
  10. You could be on to something with the IPs. I've always specified my machine name, not the IP when I create a web-reference in Visual Studio (but really, these should be functionally the same thing).
  11. DataTable.Select() will also allow you to specify a sort-order/selection-criteria, but it loads the results into a DataRow array.
  12. Have you tried running your code outside of visual studio via the .exe file in the bin\debug folder and had success on your machine? I've created a few proxies for my webservices and have had no problems distributing these proxies to every developer in the area for them to use in the project. We use a build-machine which only has the .net frameworks installed and I can run (and compile, obviously) the application from that machine with no problems.
  13. In that case, I'd probably define/use an exception (like InvalidChecksumException) to indicate to the rest of my code that something went wrong with the signal.
  14. Duh, my bad. Been a long day.
  15. You answered your own question without realizing it :D Check out System.Windows.Forms.DateTimePicker
  16. If you're that worried about edge cases, you're probably going to be putting in checks for Double.NaN in your code, so why not a check for Int.MinValue. What kind of system are you coding where you'd ever have this value? Int64.MinValue = -9,223,372,036,854,775,808 :eek:
  17. Perhaps Int32.MaxValue or Int32.MinValue would do the trick? I like that they're not just some arbitrary number that you decide means this is a bad return, they're build in to the datatype. I also make use of those when looking for the upper or lower extremities in a range of ints - like if trying for the maximum value, I init to Int32.MinValue, since all my values will be greater than (or equal to) this, etc.
  18. Create some public properties in your second form and access these when you return to the first form.
  19. Create an overload constructor in Form2 that accepts that selected-value.
  20. I believe Win2K3 server offers UDDI services. Check out this link on MS for UDDI: http://uddi.microsoft.com/default.aspx
  21. I hope this isn't one of the "can't be bothered to reinvent" items (perhaps you meant some other functions in the VisualBasic namespace though). I don't see having to write one common function to check a string for a given RegEx as a bad thing if you implement it correctly. Once you have a general function written, you only need to update the expression sent in, along with the string to search. For example (forgive the spacing): public static bool SearchStringForExpression( string textToSearch, string searchExpression ) { bool expressionFound = false; Regex expression = new Regex( searchExpression ); //perform the search in a match-collection object MatchCollection matches = expression.Matches( textToSearch ); if( matches.Count > 0 ) { expressionFound = true; } else { expressionFound = false; } return expressionFound; } [/Code]
  22. Damn - PlausiblyDamp beat me to the punch, and with a different approach!
  23. You could do a regular-expression. I think that using "[0-9]" should tell you if there's numbers in the string. Something like this should work (although there's certainly other approaches that will do the same): Regex expression = new Regex( "[0-9]" ); //perform the search in a match-collection object MatchCollection matches = expression.Matches( tableName ); if( matches.Count > 0 ) { isNumber = true; } [/Code]
  24. You need to define your table, so you can either add a Dataset to your project and design it visually, or you can create the dataTable in code and add dataColumns to this dataTable: someTable.Columns.Add( "Playername", String ); [/Code]
  25. You can do it in a few ways: the first that comes to mind it to add a reference to the MSOffice objects and use the Word API. The other is to use System.Diagnostics.Process.Start(), where you'd pass the file path as the arg to Start() and this will start the app associated with your the file-type in the path argument.
×
×
  • Create New...