Skip to content Skip to sidebar Skip to footer

How To Hold The Location Of An Image In A Sql Server Database?

I am developing a vb.net winform project that takes a persons photo ID. I want to store the location of the photo in a SQL Server database. In the project, a persons details are t

Solution 1:

In your application, your going to want to use a "OpenFileDialog" so the user can choose the file. See example below:

Dim ofd AsNew OpenFileDialog
ofd.Filter = "*.png|PNG|*.jpg|JPEG"'Add other exensions you except here
ofd.Title = "Choose your folder"'ofd.InitialDirectory = "c:\SomeFolder..." 'If you want an initial folder that is shown, otherwise it will use the last folder used by this appliaction in an OFD.If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then'Something = ofd.FileName 'Do something with the resultEndIf

Then save the result of ofd.FileName in your table. This will be the full path and name of the file they selected.

Post a Comment for "How To Hold The Location Of An Image In A Sql Server Database?"