Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

Adding code to get nodeid

I asked in another thread about a question and had it answered, below is the post.  I have another to ask, but ties into this one.

Hey Everyone,

I am needing to upload some files to the intranet.  I have a command button with this code below

   Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
        Dim MyDialog As New OpenFileDialog()
        MyDialog.InitialDirectory = False
        MyDialog.ShowHelp = True
        If MyDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then
        End If
    End Sub

That of course opens up a browser dialog to where the user can select their file or files.  What I need is a textbox below to list the files that they have selected for upload.  The upload button will come later.  My question is what code will I need to get the files to that textbox once they are selected?

Thanks
Translate:English'D91(J)-ý- FrançaisDeutschItalianoå,ž\m´Português CAA:89Español  Authored by: edfreels


Add to KnowledgeBase Unsubscribe Send To Friend Printer Friendly Add Bookmark  07.31.2007 at 01:26PM EST, ID: 19602885  



Rank: Genius
TheLearnedOne:1) If you set MultiSelect = True, then you can select multiple files.

2) The files selected are in the FileNames property for the OpenFileDialog

3) After the ShowDialog, you can determine if there was a click on <Ok> button.

    Dim MyDialog As New OpenFileDialog()

    MyDialog.InitialDirectory = False
    MyDialog.ShowHelp = True
    MyDialog.ShowReadOnly = False
    MyDialog.Multiselect = True
    If MyDialog.ShowDialog() = DialogResult.OK Then
      For Each fileName As String In MyDialog.FileNames
        Me.TextBox1.AppendText(fileName & vbCrLf)
      Next
    End If

Bob


Ok, I have a textbox to the left of the file text box that queries a stored procedure in the sql db.  I need to set this up so that when that textbox comes up and lists the states, when the user selects a state then it gets the nodeid of that state.  Once it does that we have it setup to where it knows what folder to upload these files to.  What else would I need to add to accomplish this.

Thanks
0
edfreels
Asked:
edfreels
  • 4
  • 2
1 Solution
 
edfreelsAuthor Commented:
I would be adding another command button to do the above, the upload of the files.  So the code for the nodeid query would need to be in the new command button code.
0
 
edfreelsAuthor Commented:
yea, sorry for the long post.  You have an idea on this bob?  Your other worked perfectly.  I think I just need to have it set where the datagridview is listed then when they click on the state they want on the datagridview it will know which nodeid to go to.  I still need the code for the upload command button, but thought I would clarify.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Bob LearnedCommented:
1) You have a DataGridView

2) Where/how do you want to list the states?

Bob
0
 
edfreelsAuthor Commented:
The DataGridView is connected to the stored procedure to GetAllStates.  So it is basically there to list the states, What I need is when the user clicks on the datagridview that it knows what nodeid it is that they have selected.  The upload folders are connected to the nodeid on the database.  

That second part of my question I know you can answer.  Just how to upload the files with another command button.  Not sure if I need to reference the nodeid in the new button or not?

Thanks bob
0
 
edfreelsAuthor Commented:
anyone?
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now