Jump to content
Xtreme .Net Talk

StanONE

Members
  • Posts

    4
  • Joined

  • Last visited

StanONE's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, Thanks for great help. Try this!But it met the same problem as yours. Const TAG_FNTORG As String = "<font color=" + Chr(34) + "orange" + Chr(34) + ">" Dim sourceLine As String = "<%@ TagName="SourceCtrl" ABC=""6876786""%>" Dim sourceLine2 As String = "" searchExpr = [color="#FF0080"]"(?i)" + "(?<a>(")(.*?))" + "(?<b>(.+?))" + "(?<c>(")+)"[/color] replaceExpr = TAG_FNTORG + "${a}" + "${b}" + "${c}" + TAG_EFONT If (Regex.IsMatch(sourceLine, searchExpr)) Then sourceLine2 = Regex.Replace(sourceLine, searchExpr, replaceExpr) End If
  2. Hi, I want to write a Code-to-HTML libaray and add <font color="orange"> tags to string between "" (" in html). For example, the line : will be replaced as : It means the line : would be: I'v tried to write an RE but failed. http://www.xtremedotnettalk.com/x_images/images/smilies/frown.gif Any correction appreciated! Regards, Stanley
  3. Hi all, I need to import a text file data to Oracle using ADO.NET, First I create a DataSet from Oracle table ,TEST_A, Private Sub OraOLEDB() Dim OraConn As OleDbConnection = New OleDbConnection("Provider= MSDAORA.1;" & _ "User ID = XXXX;" & _ "Password= XXXX;" & _ "Data Source=XXXX") Try OraConn.Open() Dim OraDataAdpt As New OleDbDataAdapter("SELECT * FROM TEST_A", OraConn) Dim OraDataSet As New DataSet("SA") Dim OraDataTable As New DataTable("TEST_A") OraDataAdpt.Fill(OraDataSet, "TEST_A") Catch ex As Exception MessageBox.Show(Err.Description) 'MessageBox.Show("Failed to connect to data source") Finally If OraConn.State = ConnectionState.Open Then OraConn.Close() End If OraConn.Dispose() End Try End Sub I wrote some code to split data in text file and save to DataSet: Dim FileStream As StreamReader Dim sLine As String = "" Dim TextDelimiter As String = Chr(9) '{TAB} Dim Splitout() As String Dim I As Integer FileStream = File.OpenText("c:\test.txt") Do sLine = FileStream.ReadLine() If Not sLine Is Nothing Then Splitout = Split(sLine, TextDelimiter) For I = 0 To UBound(Splitout) 'Save To DataSet Next I End If Loop Until sLine Is Nothing FileStream.Close() After done, I need to insert all data to Oracle table,but don't know how to do. Can anybody help me with this ? Or maybe you have better solution with the import feature is welcome. Cheers, Stanley
  4. Hi friends, I'v written some code to generate an error log file using VBRUN.LogEventTypeConstants in VB6 like below: ... ' Add the message type as a string Select Case nType Case vbLogEventTypeInformation sLogText = sLogText & "Info - " Case vbLogEventTypeWarning sLogText = sLogText & "Warning - " Case vbLogEventTypeError sLogText = sLogText & "Error - " Case Else sLogText = sLogText & "Unknown - " End Select ... The results will like these: ----------------------------------------------------------- 2004-03-30 10:42:45 Error Log (1.0.1), Info - Program started 2004-03-30 10:43:28 Error Log (1.0.1), Info - Enter: TestLevel1 ... 2004-03-30 10:43:28 Error Log (1.0.1), Error - (62) Input past end of file 2004-03-30 10:43:28 Error Log (1.0.1), Info - Routine call stack: 2004-03-30 10:43:28 Error Log (1.0.1), Info - TestLevel1 ... 2004-03-30 10:43:28 Error Log (1.0.1), Info - Exit: TestLevel1 ----------------------------------------------------------- Now I can't find such enumerations to follow. Is there anyway to do with the same functionality in VB.NET? :confused: Thanks!
×
×
  • Create New...