TnTinMN 418 Practically a Master Poster

Sorry I misunderstood you. I thought you were having other issues.

Can you post your ExportWeb Method?

TnTinMN 418 Practically a Master Poster

Well at least now I know the reason for doing it that way.

I would appreciate it if you could close this thread out.
Thanks

TnTinMN 418 Practically a Master Poster

I did not mention it before because I could not remember why I thought it was a bad idea, but you are directly referencing the backgroundworker in the DoWork handler. I still don't know the remifications of doing so, but the documentation tells us not it's example. http://msdn.microsoft.com/en-us/library/ms233672%28v=vs.80%29.aspx

So instead of:

Private Sub bgWorkerWMVExport_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgWorkerWMVexport.DoWork
    Try
        If Me.bgWorkerWMVexport.CancellationPending Then Return

try this:

Private Sub bgWorkerWMVExport_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgWorkerWMVexport.DoWork
    Dim bgw as BackgroundWorker = Ctype(sender, backgroundworker)

    Try
        If bgw.CancellationPending Then Return

Maybe what you are experiencing is the reason for this?

TnTinMN 418 Practically a Master Poster

neither, you are an unclosed tag name. now get noff the computer an do your homework!

if an idea is proclaimed to be half-baked, which half is ready for consumption?

TnTinMN 418 Practically a Master Poster

I am not saying this is the source of your error, but it is sure a strange statement.

Not e.Result.ToString & "" = ""

Unless there a Cancelation pending before the DoWork event fired, e.Result should always be some type of string object, either "ok" or an error message. In the case of a Cancelation, e.Result would be Nothing and e.Result.ToString should err as you can not call ToString on Nothing.

If your intent was to determine if the BGW was canceled, I would suggest changing:

If Me.bgWorkerWMVexport.CancellationPending Then Return

to

If Me.bgWorkerWMVexport.CancellationPending Then 
    e.cancel=true
    Return
end if

Then in the completion handler you could test e.Cancelled instead.

TnTinMN 418 Practically a Master Poster

carotenoids

Are we there yet?

TnTinMN 418 Practically a Master Poster

Which coat will he put on the first?

His own if it is cold outside.

Why isn't chocolate considered a vegetable, if chocolate is made from cocoa beans, and beans are considered a vegetable?

TnTinMN 418 Practically a Master Poster

You are welcome.

Your mentioned patients. I hope none of these are susceptible to photosensitive epilepsy.

TnTinMN 418 Practically a Master Poster

Here is a Word VBA macro that will split a table whenever the page number changes. It appears that you are fluent in Word Interop so it should not be too hard for you make the needed changes to convert it to VB.Net and add your Title Insert code.

Sub SplitTable(t As Word.Table)
    Dim r As Row
    Dim CurPage As Integer
    Dim LastPage As Integer
    t.Rows(1).Select
    LastPage = Selection.Information(wdActiveEndPageNumber)
        For Each r In t.Rows
        r.Select ' Selected it so its the activerange
        CurPage = Selection.Information(wdActiveEndPageNumber)
        If CurPage <> LastPage Then
            t.Split (r.Index)
            r.Select ' Selected it so its the activerange
            Dim NewTable As Table
            Set NewTable = Selection.Tables(1)
            Call SplitTable(NewTable)
            Exit For
        End If
     Next r
End Sub
TnTinMN 418 Practically a Master Poster

Let's see. You posted that two days ago, so the answer is because you were not born yesterday. :)

If one is too big for their britches, does that mean they need to lose some weight?

TnTinMN 418 Practically a Master Poster

Don,

When I stated redundant information, I did not mean within a given row.

Since it appears that you want to create some type inventory system, I would assume that you wish to store the supplier information of a given part somewhere. This is an example of what Jim mentioned could be stored in a sub-table and then your record would just store a vendor ID code instead of all vendor info in each record. But this is all a guess at this point.

I find pictures to be a lot easier to understand. Take look at this site for example database layouts.

http://www.databaseanswers.org/data_models/

As far as your current code problem, I see that you are using objCon before you have created an instance of the connection. Thus far you you only defined the variable.

I suggest you place these statements at the top of your code, they will allow the IDE to flag more potential errors for you.

Option Strict On
Option Infer Off

TnTinMN 418 Practically a Master Poster

Oh boy blinky buttons! : )

Give this button a try:

Public Class FlashyButton
   Inherits Button
   Private WithEvents FlashTimer As New Timer

   Private _AlternateBackColor As Color = Color.Green
   Public Property AlternateBackColor() As Color
      Get
         Return _AlternateBackColor
      End Get
      Set(ByVal value As Color)
         _AlternateBackColor = value
      End Set
   End Property 'AlternateBackColor


   Private _FlashDuration As Int32 = 1000
   Public Property FlashDuration() As Int32
      Get
         Return _FlashDuration
      End Get
      Set(ByVal value As Int32)
         _FlashDuration = value
      End Set
   End Property 'FlashDuration

   Private _FlashEnabled As Boolean = True
   Public Property FlashEnabled() As Boolean
      Get
         Return _FlashEnabled
      End Get
      Set(ByVal value As Boolean)
         _FlashEnabled = value
      End Set
   End Property 'FlashEnabled

   Private ElapsedTime As Int32
   Private OrigBackColor As Color
   Protected Overrides Sub OnClick(ByVal e As System.EventArgs)
      If FlashEnabled Then
         Enabled = False
         FlashTimer.Interval = 75
         ElapsedTime = 0
         OrigBackColor = Me.BackColor
         FlashTimer.Start()
      End If
      MyBase.OnClick(e)
   End Sub

   Private AltColorSet As Boolean

   Private Sub FlashTimer_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles FlashTimer.Tick
      ElapsedTime += FlashTimer.Interval
      If ElapsedTime >= FlashDuration Then
         BackColor = OrigBackColor
         FlashTimer.Stop()
         Enabled = True
         Exit Sub
      Else
         If BackColor = OrigBackColor Then
            BackColor = AlternateBackColor
         Else
            BackColor = OrigBackColor
         End If
      End If
   End Sub
End Class

Just add to your project code as a new class and rebuild the project. You should then see it at the top of your toolbox.

TnTinMN 418 Practically a Master Poster

Don,

Do all of those 170 columns define a single record? If so, I suspect based on your past references to excel that you have a lot of redundant data in there. Since you are defining the database, it behooves you to ensure that it is well designed before you start coding any application to interface with it. I suggest that you take a look at these articles.

http://en.wikipedia.org/wiki/Database_design

http://en.wikipedia.org/wiki/Database_normalization

TnTinMN 418 Practically a Master Poster

How come I can not print it?

Please show all your code.

TnTinMN 418 Practically a Master Poster

All that really matters is: 1) You enjoyed eating it and 2) you did make pay homage to the porcelain god with an involuntary oral offering after eating it.

TnTinMN 418 Practically a Master Poster

I will admit that web stuff is not my strong point.

But would not the final document received by the webrowser control you are using hold the same HTML as your function retrieves?

You can receive a lot of documents before navigation is complete due to scripts executing on the page. This can be demonstrated with this small code sample.

Public Class Form1
   Private WithEvents wb As New WebBrowser
   Private tb As New TextBox With {.Multiline = True, _
                                   .Dock = DockStyle.Fill, _
                                   .ScrollBars = ScrollBars.Both, _
                                   .Font = New Font(Me.Font.FontFamily, 12, GraphicsUnit.Point)}

   Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      tb.Parent = Me
      wb.Url = New Uri("http:\\www.daniweb.com")
   End Sub

   Private doccount As Int32 = 0
   Private Sub wb_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wb.DocumentCompleted
      doccount += 1

      tb.AppendText("Document:  " & doccount.ToString & " - " & e.Url.ToString & vbCrLf & vbCrLf)
      tb.AppendText(wb.DocumentText & vbCrLf)
      tb.AppendText(vbCrLf & New String("*"c, 60) & vbCrLf)
      If wb.Url = e.Url Then
         ' nav complete
         tb.AppendText(vbCrLf & " ********** Done!")
         Beep()
      End If
   End Sub
End Class
TnTinMN 418 Practically a Master Poster

Typically, in those countries they do not have access to the highly concentrated stuff that is available here like soymilk or protein powders. There has been many reports over the years to worn women on certain therapies to avoid soy because its estrogen-like effects, but that article was the first I've seen about its possible effects on men.

In terms of having some tofu as a small part of your diet, you are probably correct. But unfortunately, people see some type of health claim and think that if a little bit is good, then a lot must be better. One of may favorite responses to people who are eating something that they claim is healthy because its non-fat is to point out that a five pound bag of sugar is non-fat as well but eating it sure is not a healthy choice. :)

Another reason that I posted this is that at one time, soy nuts were a favorite snack of mine, but I noticed that I soon was not feeling right after eating them. Granted I usually would go through an 8 oz. bag at time, but for the typical person eating junk food, that is not really that uncommon of an amount.

We also have the blessing of heavy agri-chem use in this country and some of the pesticides also have similar effects. Those you will occasionally hear about because our so-called news is always willing to run some type of story to scare people to garner a …

TnTinMN 418 Practically a Master Poster

Guy, and I mean the men reading this. Please do yourself a favor and read this article if you think that soy is by definition good for you.

TnTinMN 418 Practically a Master Poster

coding virus using vb script .vbs

Granted it is pretty pathetic, but some fool is looking for help to run the code shown.

TnTinMN 418 Practically a Master Poster

Your code should not be generating the problem you are seeing. I was expecting to see you using the TabPages.Insert method. Per the documentation:

The order of tab pages in the TabControl.TabPages collection reflects the order of tabs in the TabControl control. To change the order of tabs in the control, you must change their positions in the collection by removing them and inserting them at new indexes.

The only thing that I can think of is that your memory has somehow been corrupted. When was the last time that your performed a reboot? It's worth a try to see if remedies the problem.

What VB version are you using? 2010, 2012 or something else? If it is 2012, try target .Net 3.5 or 4.0 instead of 4.5. In another thread, we discovered some atypical behavior from 4.5.

Sorry, I can't be of more assistance, but that just should not be happening.

TnTinMN 418 Practically a Master Poster

Well, let's look at your code that determines if it is a right trianle.

      If (s1s + s2s = s3s) Then
         ' Display the result
         triResult = "You have created a right triangle!"
      End If

If s1=3, s2=5, and s3 =4 will the above test that you defined be true?
Have you learned how to use either arrays or lists yet? If, consider loading your values into an array and sorting it low to high. The high value will be the hypotenuse. Then you can calculate the squares and run your tests.

TnTinMN 418 Practically a Master Poster

Please show us the code you use to add the tabpage otherwise we are just making uninformed guesses as to what the problem may be.

TnTinMN 418 Practically a Master Poster

I have tested this by casting the webbrowser.Document.DomDocument, so hopefully it will work for you.

You used: Dim htmlDocument As mshtml.IHTMLDocument2 = DirectCast(New mshtml.HTMLDocument(), mshtml.IHTMLDocument2)

recast as mshtml.IHTMLDocument3

   Dim doc3 As mshtml.IHTMLDocument3 = DirectCast(htmlDocument, IHTMLDocument3)
   For Each img As mshtml.IHTMLImgElement In doc3.getElementsByTagName("img")
      Debug.WriteLine(img.src)
   Next
TnTinMN 418 Practically a Master Poster

Try recasting the document to a IHTMLDocument3 use getElementsByTagName on the new cast object,

TnTinMN 418 Practically a Master Poster

If it's dynamic code execution, then that can be handled via CodeDom and compile on the fly. Not to difficult to do, but takes some setup to get right.

But based on my understanding of the OP's stated situation, it looks like just some value that needs to be referenced by name.

TnTinMN 418 Practically a Master Poster

Hi to all,This is the error rise::"Unable to cast object of type 'System.Int32' to type 'System.String'".

I suspect that the error is occuring in one of the dr.GetString(#) statements.

Try. dr.Item(#).ToString() instead.

Substitute the actual integer for "#" in the above statements.

TnTinMN 418 Practically a Master Poster

after this there existed a variable with the name and value as requested

This sounds like a key-value pair to me. Perhaps a Dictionary will work.

Begginnerdev commented: Dictionaries are a life saver. +0
TnTinMN 418 Practically a Master Poster

Hey, hey, hey — don't be mean. We don't have to be mean. 'Cause, remember: no matter where you go... there you are. --- Buckaroo Banzai

TnTinMN 418 Practically a Master Poster

I'm not sure if this product is even sold in the mid west or west coast.

It's a Cargill product. http://www.shadybrookfarms.com/Contact.aspx
Who knows where it originates from. Looks like the pink stuff that they were selling as hamburger meat.

TnTinMN 418 Practically a Master Poster

Granted. You wake up, walk into the bathroom, look in the mirror and it suddenly dawns on you the meaning of: "Be careful what you wish for".

I wish for chocolate-strawberry milkshake.

@AD - What is a TnTinMn - good question! Answer: old fart playing child's game with a child.

TnTinMN 418 Practically a Master Poster

granted; however you are captured and used in ebola virus research.

I wish my cute friendly animal comes back to life and eats that mean person who ran over him.

TnTinMN 418 Practically a Master Poster

You have mixed together various statements that are not necessarily related.

     ConnectionSettings() ' this does what?

     ' I assume that con is a MySqlConnection defined elsewhere
    ' don't need to open connect, the dataadapter will handle open/close
    'con.Open()

    Dim sql As String

    ' you do realize that this dataset will only exist in the context of this code block?
    Dim ds As New DataSet
    Dim da As MySqlDataAdapter

    Dim RowsNo As Integer ' purpose for this ?

    Dim cmd as New MySqlCommand()
    cmd.Connection = con

    sql = "SELECT * FROM tblStudents WHERE StudentID = @studentid"
    cmd.CommandText = sql
    cmd.Parameters.AddWithValue("@studentid", txtStudentID.Text)

    ' why this is here I have no clue
    'cmd.ExecuteNonQuery()

    ' feed the dataadapter the command
    dim da as New MySqlDataAdapter(cmd)

    ' use the adapter to create and fill the table Students
    da.Fill(ds, "Students")

    msgbox(ds("Students").Rows.count.ToString)
TnTinMN 418 Practically a Master Poster

Chipmunks. Always good for a laugh.

Favorite Icecream?

TnTinMN 418 Practically a Master Poster

Granted.

Now what are you going to do about that burning sensation south of the beltway.

I wish for a cute friendly animal that will grant my every wish.

TnTinMN 418 Practically a Master Poster

The blank dusty screen.

How many would be lost with out TV to tell them what to think?

Edit: oops forgot thread topic

What is your favorite question?

TnTinMN 418 Practically a Master Poster

So I take my favorite word and mix it with numbers, like:
b1u2l3l4s5h6i7t

I see into the future and Ene Uran's account has been hacked. :)

tux4life commented: :D +0
TnTinMN 418 Practically a Master Poster

My 2 cents worth on this is if this site actually allowed us to put articles under the tuturial tab that could be referenced a lot of this would be less painful all the way around. I would actually like to see the Tutorial section be a wiki of sorts. I know that would have to have some restrictions put on it in terms of deleteing/editing, but I think that a workable solution could be found where one of the staff could review the submissions before allowing the content to go public.

TnTinMN 418 Practically a Master Poster

I may be mistaken here, but under VB2010 Express you can use the ReportViewer control, however you will not have design time support for either the control nor the Report. The only way I have been able to make this work is to add the control to the Form via your own code.

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'ReportViewer1
    '
    ' place and size the control
    Me.ReportViewer1.Location = New System.Drawing.Point(10, 10)
    Me.ReportViewer1.Name = "ReportViewer1"
    Me.ReportViewer1.Size = New System.Drawing.Size(300, 200)
    Me.ReportViewer1.TabIndex = 0
    Me.ReportViewer1.Parent = Me

    ' the next line load the XML report file for the application directory.
    ' you can locate the file anywhere you wish, just adjust the path
    Me.ReportViewer1.LocalReport.ReportPath = ".\Report1.rdlc"

    ' tells the viewer to refresh with the currently loaded report
    Me.ReportViewer1.RefreshReport()

End Sub

Sample report definition file:

<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2005/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <InteractiveHeight>11in</InteractiveHeight>
  <rd:DrawGrid>true</rd:DrawGrid>
  <InteractiveWidth>8.5in</InteractiveWidth>
  <rd:SnapToGrid>true</rd:SnapToGrid>
  <RightMargin>1in</RightMargin>
  <LeftMargin>1in</LeftMargin>
  <BottomMargin>1in</BottomMargin>
  <rd:ReportID>2ae1843f-1c7c-4caf-80ae-3fd92ba70b98</rd:ReportID>
  <Width>6.5in</Width>
  <Body>
    <ReportItems>
      <Textbox Name="textbox2">
        <rd:DefaultName>textbox2</rd:DefaultName>
        <Top>0.125in</Top>
        <Width>1.125in</Width>
        <Style>
          <PaddingLeft>2pt</PaddingLeft>
          <PaddingRight>2pt</PaddingRight>
          <PaddingTop>2pt</PaddingTop>
          <PaddingBottom>2pt</PaddingBottom>
        </Style>
        <CanGrow>true</CanGrow>
        <Left>0.25in</Left>
        <Height>0.375in</Height>
        <Value>hello</Value>
      </Textbox>
    </ReportItems>
    <Height>2in</Height>
    <Style>
      <BackgroundColor>LightGrey</BackgroundColor>
    </Style>
  </Body>
  <Language>en-US</Language>
  <TopMargin>1in</TopMargin>
</Report>
Begginnerdev commented: Nice example! +8
TnTinMN 418 Practically a Master Poster

Are we going to have to separate you two?? %\

TnTinMN 418 Practically a Master Poster

You have everything you need already. You just need to create an instance your class.

        PlotParameter pm = new PlotParameter();
        pm.AreaId = "id-1";
        pm.ParameterName = "fred";
        pm.ParameterValu = "wilma";
TnTinMN 418 Practically a Master Poster

Might as well take it the rest of the way and get the top 5 that the OP wants.

SELECT TOP 5 Count(ContactInfo.CustomerID) AS CustomerCount, ContactInfo.City
FROM ContactInfo
GROUP BY ContactInfo.City
ORDER BY Count(ContactInfo.CustomerID) DESC 

Note that this can return more than 5 records if multiple cities have the same count.

TnTinMN 418 Practically a Master Poster

Are you trying to tell us that you do not understand how to use the CommonDialog to retrieve the selected file?

If so, take a look at this link: http://www.developerfusion.com/article/11/common-dialog-control/3/

TnTinMN 418 Practically a Master Poster
TnTinMN 418 Practically a Master Poster

YouTube users may find this interesting: Legal liability for YouTube viewers

TnTinMN 418 Practically a Master Poster

Spectrex

TnTinMN 418 Practically a Master Poster

Unfortunately some people don't have the luxury to wait (or at least don't have the power to make such decisions).

Interesting perspective. Usually it is the other way around at least in my experience (which admittedly is limited, but I have read of many others who in the same situation).

Well, anyways good luck and please post back with a link to your report. I will vote it up to see if that helps pod along the elephant.

TnTinMN 418 Practically a Master Poster
TnTinMN 418 Practically a Master Poster

Or it is a glitch in the 4.5 Framework. This is why many refuse to use a version of .Net until it has been vetted for a few years. Unfortunately MS's bug reporting automatically discounts rerports of bugs that are not being reported for their latest and greatest even if the bug has existed in all versions. Lesson learned if you find a bug using an old .Net framework, reproduce it on the newest or else you will be ignored. I recently got blown off for reporting an error in VB2010 and I haven't had time or need to install the needed stuff to support VS2012.

I suggest that you file a report at: http://connect.microsoft.com/

TnTinMN 418 Practically a Master Poster

Yes, mine is .Net 3.5.

Well there is a difference in the IL (extracted using Reflector) on the string concat and the concat if the only difference.

Mine:

[System]System.Diagnostics.Stopwatch::Start()
        L_0049: ldloc.s chArray
        L_004b: call string [mscorlib]System.String::Concat(object)
        L_0050: pop 
        L_0051: ldloc.1 
        L_0052: callvirt instance void 
[System]System.Diagnostics.Stopwatch::Stop()

Yours:

[System]System.Diagnostics.Stopwatch::Start()
        L_0049: ldloc.s chArray
        L_004b: call string [mscorlib]System.String::Concat<char>(class [mscorlib]System.Collections.Generic.IEnumerable`1<!!0>)
        L_0050: pop 
        L_0051: ldloc.1 
        L_0052: callvirt instance void [System]System.Diagnostics.Stopwatch::Stop()

I wonder what would happen if you targeted 3.5 instead.

TnTinMN 418 Practically a Master Poster

Think about a sports nutritionist, they can refer you to any supplements and sell you any of them but they don't lift... They say, "Basically, this helps you build mass fast...".... Probably not the best example...

Michael, I am glad that you admit that that is not a good example because you are describing a saleperson using a title that they hope implies a professional status. It is their job (like it or not) to push that #@@!@.

I know that you are still young and may have yet to experience trying to explain something to a person who does not have have the knowledge to understand what you are trying to convey to them. It is often necessary to use phrases like "basically" and "maybe" to soften your presentation and not put them in a defensive mode (people hate to appear dumb). I have a good friend who does not have the education that I possess, but he is in no way dumb. When he asks me for technical help he wants to know the full explaination, but if I were to dump the info on him in my vernacular his eyes would glass over. So, my point is don't judge a person as being full of it just because they may not be skilled enough to communicate effectively.

However, in the case of salespeople, always assume they are lying and full of it. :))