Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: RhymesWithOrange
  • Order by date
  1. RhymesWithOrange

    Default property with parameter problem.

    You need a better vb to c# converter - try Instant C# (wwww.instantcsharp.com). I used it to get: public string this[int index] { get { return List[index].ToString(); } set { List[index] = value; } }
  2. RhymesWithOrange

    semicolon in a string??

    Have you tried: ";" ??? You obviously have, since you're asking the question here, but it works fine on my machine... no escaping necessary.
  3. RhymesWithOrange

    Convert string to integer..

    The VB.NET to C# converter Instant C# makes a static class available to mimic the robustness of the VB cast macro "CInt": internal static int CInt(object oValue) { try { if (oValue == null || System.Convert.IsDBNull(oValue)) //default null to 0 (identical to the VB.NET cast): return...
  4. RhymesWithOrange

    New at C#

    If you know the VB code, just download the Instant C# free version and convert it!
  5. RhymesWithOrange

    Code Conversion Challenge!

    Using the Instant C# VB.NET to C# converter (www.instantcsharp.com), I get: //TODO: INSTANT C# TODO TASK: Insert the following converted event handlers at the end of the 'InitializeComponent' method for forms or into a constructor for other classes: //DataList1.ItemDataBound += new...
  6. RhymesWithOrange

    msgbox

    Just out of curiousity, why not use MessageBox.Show ? It's virtually identical - the enums match pretty well one-to-one. (in the System.Windows.Forms namespace which you're probably using anyway)
  7. RhymesWithOrange

    VB.Net developer transitioning to C#

    Download a good vb to c# converter. Instant C# is the best one I know of (www.instantcsharp.com) - the demo would probably be all you need to convert some small samples as you need it to see how some things are done in C# vs VB.
  8. RhymesWithOrange

    Newbie 2 C# (VB programmer)... Try-Catch-Finally?

    Quote (is there a way to do quotes on this group?): So are VC# and VB.Net basically the same except for the way you write your blocks, and syntax structure? Actually, the syntax differences are more substantial than first appears. There's a good short summary of some of the more devious ones...
  9. RhymesWithOrange

    Newbie 2 C# (VB programmer)... Try-Catch-Finally?

    Well, you'd have to have Try/Catch around every line of code in order to reproduce the functionality of Resume Next. I didn't think of that when I said the only option was to have a line counter and goto's, but even so you wouldn't want to have Try/Catch around every line. The 'trick' of the...
  10. RhymesWithOrange

    Newbie 2 C# (VB programmer)... Try-Catch-Finally?

    Personally, I don't see Try/Catch as a huge improvement, although I like exceptions better than meaningless error numbers. Contrary to what someone posted here, there is no Try/Catch equivalent to "Resume Next". To ignore the exception in the Catch block, you're not resuming at the line...
  11. RhymesWithOrange

    Newbie 2 C# (VB programmer)... Try-Catch-Finally?

    It's the .net approach to error handling. Try: the mainstream logic Catch: where you 'goto' when something goes wrong Finally: do this stuff *always*, even if something goes wrong. Using Instant C# (the vb.net to c# converter), here's an example of old vb6-style error handling in vb.net and...
  12. RhymesWithOrange

    vb.net to c#.net

    Yeah, I've noticed that with Instant C# on a couple of things with extra brackets... I guess it's to play it safe.
  13. RhymesWithOrange

    vb.net to c#.net

    I get the following from Instant C#: byte[] sid; sid = ((byte[])(groupSid));
  14. RhymesWithOrange

    Fastest way to write event handlers

    This is one of the less obvious parts of the C# IDE. I just recently found out about it. Select a control, bring up the properties, and click on the lightening bolt (for events). From that property view, you'll be able to add events as easily as from VB.
  15. RhymesWithOrange

    change string element?

    In practice, using regular strings is actually very efficient when the strings are small. I write a few very intensive string manipulation apps and using StringBuilder only boosts their performance when accumulating or adding on to very large strings. For example, if you're parsing through a...
  16. RhymesWithOrange

    change string element?

    Unfortunately, there doesn't seem to be a one-statement way to do this in .NET, but here's what I do: mystr = mystr.Remove(3, 1); mystr = mystr.Insert(3, "d"); Or, one line: mystr = mystr.Remove(3,1).Insert(3, "d");
  17. RhymesWithOrange

    Using Microsoft.VisualBasic.Compatibility assembly in C#?

    You need to set a reference to the assembly: Microsoft VisualBasic .NET Compatibility Runtime Then you can just do Microsoft.VisualBasic.Compatibility... in your code.

Part and Inventory Search

Back
Top