Click here to Skip to main content
15,922,315 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
HI everybody

I Have an application in visual basic 2008"vb.net" that should allow the user in its interface to browse to choose a database file.
can anybody help me to create this browser

thanks
Posted
Comments
Sergey Alexandrovich Kryukov 20-Jun-11 21:35pm    
What kind of help do you want? Why doing it? What will make it different? Orthodox file manager? Explorer is pretty bad program; do you want to offer something better? What library do you want to use, Forms, WPF, something else? What do you think will be your contribution? Why do you think some of the experts could be interested in helping you?

--SA

As per what I understand from your question is that
You need to browse for selecting a Database file
So as per me why don't you use a openfiledialog control
and open this on a Browse Button click
Filter the openfiledialog for database files.and then you can select the
required files from there.May this can give you a start.
Private Sub BtnBrowse_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnBrowse.Click
        Using OpenFileDialog As OpenFileDialog = Me.GetOpenFileDialog()

            If (OpenFileDialog.ShowDialog(Me) = DialogResult.OK) Then
                TxtFileName.Text = OpenFileDialog.FileName

            Else
                Exit Sub
            End If
        End Using
    End Sub

Here TxtFileName is a textBox which shows the selected file.Below is the function to filter the openFileDialog.
Private Function GetOpenFileDialog() As OpenFileDialog
        Dim openFileDialog As New OpenFileDialog

        openFileDialog.CheckPathExists = True
        openFileDialog.CheckFileExists = True

        openFileDialog.Filter = "SQL data files (*.mdf)|*.mdf"

        openFileDialog.Multiselect = False
        openFileDialog.AddExtension = True
        openFileDialog.ValidateNames = True
        openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)

        Return openFileDialog
    End Function

That's all Try This.I am not an Expert But may this can help you out.You can Search Google for Filtering Database File inside Openfiledialog.I have just provided you here One.
 
Share this answer
 
v2
Comments
nourbt 21-Jun-11 5:06am    
karwavivek

Thank you very much that really what i was asking about...
Thanks again
You can start with this[^] sample.

You will basically first need to choose the database path and file using this browser. How you load the database depends on the database and is upto you.
 
Share this answer
 
If you Google it, you might find some answers.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900