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
I

Icharus

@Icharus
About
Posts
15
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Call a function of other form [modified]
    I Icharus

    I am hoping this is not for your homework, but, I will answer nonetheless. Two simple ways to accomplish this would be: 1. Declare your method in Form1 as static and invoke it from Form2 like so: In Form1...

     public static void Hola()
     {
          MessageBox.Show("Hello");
     }
    

    In Form2...

     public void InvokeMessage()
     {
          Form1.Hola();
     }
    

    2. Using your declaration like so: In Form2...

     public void InvokeMessage()
     {
          // "using" so Form1 is disposed at end of method.
          using(Form1 otherForm = new Form1())
          {
               otherForm.Hola();
          }
     }
    
    C# csharp help tutorial

  • string Replace in vb.net
    I Icharus

    Try using double quoutes like so: str = Replace(str,"

    Visual Basic csharp com help

  • Strip out invalid characters from xml files [modified]
    I Icharus

    Thanks to Christian and Guffa. Below is the solution I was able to come up with...

    Public Structure HexReplacement
    Public HexCharacter As Char
    Public Replacement As String
    End Structure

    Public Shared Function ConvertHexToChar(ByVal hexValue As String) As Char
    Dim convertedChar As Char = Nothing
    Try
    convertedChar = Chr(Int32.Parse(hexValue, Globalization.NumberStyles.HexNumber))
    Catch ex As FormatException
    ' Error handling here....
    Catch ex As ArgumentException
    ' Error handling here....
    End Try
    Return convertedChar
    End Function

    Public Function CleanOutHexValues(ByVal dirtyString As String, ByVal hexReplacements As HexReplacement()) As String
    Dim cleanString As String = dirtyString
    For Each hr As HexReplacement In hexReplacements
    cleanString = cleanString.Replace(hr.HexCharacter, hr.Replacement)
    Next
    Return cleanString
    End Function

    Public Sub TestHexCharCleanUp()
    Dim hr(1) As HexReplacement
    hr(0).HexCharacter = ConvertHexToChar("0b") ' "0b" = or single space.
    hr(0).Replacement = ""
    Dim dirtyString As String = "Testing the removal of "
    MsgBox(CleanOutHexValues(dirtyString, hr))
    End Sub

    Comments will be greatly appreciated. :)

    Visual Basic question xml help

  • Strip out invalid characters from xml files [modified]
    I Icharus

    Can someone help me with the following: 1- I have xml text data that i need to take out invalid characters from. 2- this data contains extraneous characters that i need removed in order to use xmlDocument.LoadXml(str) 3- when this characters are in the str variable i get an XmlException that indicates that there's an invalid character with hex value of 0x0B. 4- how can i remove that character from the string prior to loading it in with xmlDocument.LoadXml(str)? 5- i am using VS2005 Your help is greatly appreciated....:confused: -- modified at 23:11 Thursday 17th August, 2006

    Visual Basic question xml help

  • Search button
    I Icharus

    Try the following with your function: Public Function GetAllChangeControl() As String Dim con As OleDbConnection Dim cmd As OleDbCommand = New OleDbCommand con = New OleDbConnection(connectionstring) cmd.Connection = con cmd.CommandText = "EXECUTE GetAllChangeControl" con.Open() '--------------------------------------------- ' Here is the change Dim retVal As Object Try retVal = cmd.ExecuteScalar() If Not(IsNothing(retVal)) Then Return Cstr(retVal) Else Return String.Empty End If Catch ex As OledbException Throw ex Finally con.Close() If Not con Is Nothing Then con.Dispose If Not cmd Is Nothing Then cmd.Dispose End Try '------------------------------------------ End Function Let me explain, it is possible that your "cmd.ExecuteScalar" is not returning anything and you are not checking for that, so what I've done here is do a simple check and return the appropriate value. I have also enclosed the procedure in a Try statement to capture the Exception, and make sure that even if an Exception is thrown, the connection is closed and you realease your resources. I hope this helps.

    Visual Basic database help

  • Dynamic Tab pages and Streamwriter
    I Icharus

    Yes I'd love to see what you have so far, and maybe I can be of some assistance. I'm always looking for new challenges. Also, I have been looking for an excuse to use VS.Net 2005, but I have been a bit lazy and out of ideas. (Too many brain cells used at my real job. lol)

    Visual Basic help tutorial question

  • Dynamic Tab pages and Streamwriter
    I Icharus

    Looks good. I'm just glad to have been of some guidance.:) What exactly are you building, if you don't mind my asking? I sounds like a Notepad substitute, if it is, I like the tabbed approach.

    Visual Basic help tutorial question

  • Dynamic Tab pages and Streamwriter
    I Icharus

    Try the following: For Each tabCtl As TabPage In TabControl1.TabPages For Each ctl As Control In tabCtl.Controls If TypeOf ctl Is RichTextBox Then ' Code to save the contents.... End If Next Next Hope this helps.

    Visual Basic help tutorial question

  • Quick Syntax Question
    I Icharus

    Here's a somewhat reference page that might be helpful. http://www.harding.edu/USER/fmccown/WWW/vbnet_csharp_comparison.html[^]

    Visual Basic csharp question

  • ShowDialog Bug
    I Icharus

    I noticed a bug with using ShowDialog to display a custom dialog box, and then using ShowDialog from that custom dialog to display a FolderBrowserDialog. The problem is when I select "Ok" or "Cancel" on the FolderBrowserDialog, both dialog boxes disapear. Has anyone else run into this problem? And if you have, have you been able to get around it? Thanks in advance.

    Visual Basic help question

  • How do I query dates stored in a varchar field?
    I Icharus

    Thanks everyone for your help! I ended up using the following statement: WHERE (UPPER(field7) = 'WORK ORDER') AND (field14 BETWEEN @startdate AND @enddate) Following airbus' suggestion to use UPPER, and documentation I found in SQL Sever Bible Thanks again!

    Database question database help

  • How do I query dates stored in a varchar field?
    I Icharus

    Rob thanks for your quick response! Yes it is MSSQL 2000. Now please pardon my ignorance, but, if I have records with dates greater than 9/1/05, the following statement should return all those records rigt? SELECT field7, field13, field14 FROM myTable WHERE (CAST(field14 AS Datetime) >= '2005-09-01') AND (field7 = 'Work Order') But my result set is empty. What am I missing?

    Database question database help

  • How do I query dates stored in a varchar field?
    I Icharus

    Hi everyone, I am attempting to read records from a table based on a date range, however, the dates are stored in a varchar field. The format of the date is 2005-09-01 10:50:00. How can I get around the fact that the vendor used the wrong data type? Your help is greatly appreciated.

    Database question database help

  • Algorithm for Unique Keys?
    I Icharus

    I was wondering if anyone out there knows of an algorithm to generate unique alpha-numeric keys for database use.

    Visual Basic database algorithms question

  • VB.NEt instance checking app
    I Icharus

    Here is a quick and dirty way of checking for a process. First you need a reference to the SystemDiagnostics. Imports System.Diagnostics Then Dim myProcess As Process() = Process.GetProcessesByName("ProcessName") If myProcess.Length > 1 Then MsgBox("You can only have one instance of this application running.") End If Hope this helps :-)

    Visual Basic csharp question learning
  • Login

  • Don't have an account? Register

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