daily pastebin goal
86%
SHARE
TWEET

Untitled

a guest Feb 19th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. my code
  2. -------
  3.   ada.Fill(ds, "reports.renewal_contact_t ")
  4.  
  5.                 ds.Tables(0).DefaultView.RowFilter = " PHONE NOT like'0'"
  6.                 dt = ds.Tables(0)
  7.                 For Each q In dt.Rows
  8.                     chkphone = q("PHONE").ToString
  9.                     chkdphone = Regex.Replace(chkphone, "[^d]", "")
  10.  
  11.                     'MessageBox.Show(chkdphone)
  12.  
  13.  
  14.                     If (chkdphone.Length = 10) Then
  15.                         Dim anyRow As DataRow = dt2.NewRow
  16.                         anyRow(0) = chkphone.ToString
  17.                         dt2.Rows.Add(anyRow)
  18.  
  19.                     ElseIf (chkdphone.Length >= 10) Then
  20.                         rsltstring = chkdphone.Substring(chkdphone.Length, -10)
  21.  
  22.                         Dim anyrow1 As DataRow = dt2.NewRow
  23.                         anyrow1(0) = rsltstring.ToString
  24.                         dt2.Rows.Add(anyrow1)
  25.                     Else
  26.  
  27.  
  28.                     End If
  29.                 Next
  30.  
  31.                 new_ds.Tables.Add(dt2)
  32.                 ComboBox1.DataSource = new_ds.Tables(0)
  33.                 ComboBox1.DisplayMember = "PHONE"
  34.  
  35.  
  36.  
  37.  Error
  38.  -----
  39.  length cant be less than zero parameter name length
  40.    
  41. rsltstring = chkdphone.Substring(chkdphone.Length - 10, 10)
  42.    
  43. rsltstring = chkdphone.Substring(chkdphone.Length - 10)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top