Click here to Skip to main content
15,902,634 members

Comments by wiswalld (Top 30 by date)

wiswalld 16-Jul-12 10:57am View    
So I found this

Dim strAsHtmlTableData As String = ""
Dim intlndex As Integer = 0
For Each tblElements As System.Windows.Forms.HtmlElement In Me.WebBrowser1.Document.GetElementsByTagName("Client ID:")
Me.TextBox1.Text = tblElements.OuterHtml
intlndex += 1
Next

Trying to get: 784543117

out of this. I cut before and after the part that I need. Not sure what the element name is. I tried

Client ID:


nbsp;  <label class="readOnly">Client ID:</label> 784543117</td></tr><tr><td
wiswalld 14-Jul-12 12:08pm View    
Its a big section and some of it I removed as it is sensitive
wiswalld 14-Jul-12 12:06pm View    
<div id="viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_:resultsForm:_id139" class="panelSection"><div id="viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_:resultsForm:_id139-header" class="panelSection-header"><div id="viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_:resultsForm:_id139-header-opened" class="twistyOpen"><div>Results</div></div><div id="viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_:resultsForm:_id139-header-closed" class="twistyClosed"><div>Results</div></div></div><script type="text/javascript">jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-header-opened-link").click(function() { jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-body").toggle("blind"); jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-header-opened-link").toggle(); jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-header-closed-link").toggle(); } );jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-header-closed-link").click(function() { jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-body").toggle("blind"); jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-header-opened-link").toggle(); jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-header-closed-link").toggle(); } );</script><script type="text/javascript">jQuery(function(jQuery) { var panelSection = jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139")[0]; jQuery("#viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_\\:resultsForm\\:_id139-body script").each(function() { panelSection.appendChild(this); });});</script><div id="viewns_7_BMLR5Q8518NO70IAHI92FK30Q6_:resultsForm:_id139-body" class="panelSection-body"><div style="width: 100%;"><table class="formSection"><tr><td class="formSectionHeaderCriteria">Search Criteria</td><td class="formSectionContentCriteria"><p><span style="white-space: nowrap;"><label class="readOnly">Client ID (CID):</label> REMOVED BY ME</span> </p></td></tr><tr><td class="formSectionHeader">DMV Drivers License</td><td class="formSectionContent"><div class="summaryDetail"><table><tr><td class="alignRight"><label class="readOnly">Status:</label></td><td class="alignLeft">VALID (Non-CDL)   VALID (CDL)</td></tr><tr><td class="alignRight"><label class="readOnly">License Class:</label></td><td class="alignLeft">CDL *AM*   <label class="readOnly">Expiration:</label> 03/15/2019</td></tr><tr><td class="alignTopRight"><label class="readOnly">Name:</label></td><td>REMOVED BY ME   <label class="readOnly">Client ID:</label> REMOVED BY ME</td></tr><tr><td class="alignTopRight"><label class="readOnly">Birth Date:</label></td><td><
wiswalld 2-Jun-12 15:09pm View    
All the examples I have seen are in WPF. I kind of figured it was difficult as no windows forms examples. Thanks.
wiswalld 28-Apr-12 13:50pm View    
There are values

I use this to populate a datagridview from an excel sheet
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection("provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\Temp\Sex.xls';Extended Properties=Excel 8.0;")
MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [Sheet1$]", MyConnection)
MyCommand.TableMappings.Add("Table", "Net-informations.com")
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
MyConnection.Close()

Then I am trying to save to sql table using

Dim con As New SqlConnection
con.ConnectionString = "Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\Database1.mdf;Integrated Security=True;User Instance=True"
con.Open()


For i As Integer = 0 To Me.DataGridView1.Rows.Count - 1
Dim cmd As New SqlCommand()
cmd.Connection = con
cmd.CommandText = "Insert into table2(aa,bb) Values(@firstname,@lastname)"
cmd.Parameters.AddWithValue("@firstname", DataGridView1.Rows(i).Cells(0).Value)
cmd.Parameters.AddWithValue("@lastname", DataGridView1.Rows(i).Cells(1).Value)
cmd.ExecuteNonQuery()
Next