473,669 Members | 2,415 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to browse MDB file in DataGridView and TIF Images in ImageViewer?

9 New Member
Expand|Select|Wrap|Line Numbers
  1. Imports System.IO
  2. Imports System.Data
  3. Imports System.Data.OleDb
  4. Imports Microsoft.VisualBasic
  5.  
  6.  
  7. Public Class CARD_DECK_ENTRY Public myConString As String Dim con As New OleDb.OleDbConnection Dim myStream As Stream = Nothing
  8.  
  9. Private Sub ExitToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitToolStripMenuItem.Click
  10.     End
  11.     Operator_ID.Close()
  12. End Sub
  13.  
  14. Private Sub OpenFileToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenFileToolStripMenuItem.Click
  15.  
  16.     Dim openFileDialog1 As New OpenFileDialog()
  17.  
  18.     openFileDialog1.InitialDirectory = "c:\"
  19.     openFileDialog1.Filter = "mdb files (*.mdb)|*.mdb|All files (*.*)|*.*"
  20.     openFileDialog1.FilterIndex = 1
  21.     openFileDialog1.RestoreDirectory = True
  22.  
  23.  
  24.     If openFileDialog1.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
  25.         Try
  26.             myStream = openFileDialog1.OpenFile()
  27.             If (myStream IsNot Nothing) Then
  28.                 myConString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & openFileDialog1.FileName
  29.                 Dim x As String = openFileDialog1.FileName.Substring(0, openFileDialog1.FileName.Length - 20) & "Images"
  30.                 con.ConnectionString = myConString
  31.                 con.Open()
  32.  
  33.                 datagridshow()
  34.             End If
  35.         Catch Ex As Exception
  36.             MessageBox.Show("Cannot read file from disk. Original error: " & Ex.Message)
  37.         Finally
  38.             ' Check this again, since we need to make sure we didn't throw an exception on open. 
  39.  
  40.             If (myStream IsNot Nothing) Then
  41.                 myStream.Close()
  42.             End If
  43.         End Try
  44.     End If
  45.  
  46. End Sub
  47.  
  48.  
  49. Private Sub CARD_DECK_ENTRY_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  50.  
  51.     con.ConnectionString = myConString
  52.  
  53.     con.Open()
  54.  
  55.     datagridshow()
  56.  
  57. End Sub
  58.  
  59. Private Sub datagridshow()
  60.     Dim ds As New DataSet
  61.     Dim dt As New DataTable
  62.     ds.Tables.Add(dt)
  63.     Dim da As New OleDbDataAdapter
  64.  
  65.     da = New OleDbDataAdapter("Select * from Data001", con)
  66.     da.Fill(dt)
  67.  
  68.     DataGridView1.DataSource = dt.DefaultView
  69.  
  70.     con.Close()
  71.  
  72.  
  73. End Sub
---

The above codes was to browse an MDB file and it worked, but now i'm about to load the images into a imageViewer with same time on browsing mdb. As you can see in the above codes, there was ("Select * from Data001", con) because it was a table I will be showing on the DataGridView. On the database there was a two table, those are "CardDeck" and "Data001." In CardDeck there was a "Image001" column. This column contains tif image names. On the folder where the database was found there was another folder on the same path(path of the database folder) named "Images". The column value of "Image001" will be found there. My point is how can I browse those "Image001" column value to a ImageViewer where those value are located in Folder "Images"? Please help. :'(
Jan 28 '16 #1
0 996

Sign in to post your reply or Sign up for a free account.

Similar topics

0
973
by: ktenney | last post by:
Howdy, I've written some code which manipulates images, now I want an interface for choosing images. I'm curious what people might recommend as the easiest way framework to do the following: - present a (directory) view, with images represented by thumbnails
3
3477
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or less would display, but those close to 300 pixels/inch or greater would not (MS Access cannot recognize the file format xxx.jpg). The larger, original images were scanned and saved as .bmp (at 300 dpi producing a 15MB file). Then the images were...
2
2179
by: Anita C | last post by:
Hi, On the click of a button I want to be able to display a dialog so that a file can be picked , the name of which needs to be passed to a function as a parameter in my asp.net app.. However for the file dialog I need to specify the type of file and the directory which can be browsed. Can someone please point out articles/code samples which will help achieve the above. Thanks a lot.
3
1461
by: Darren | last post by:
Hi, I am not an experienced PHP programmer and have look on the net for what I want to do. I'd like to allow the user on my website to upload two images one is to be turned into a thumbnail and one is to be turned into something of around 500 x 300, one stored in a thumbnail folder and one stored in an image folder.
3
5396
by: den 2005 | last post by:
Hi everybody, I like to allow user to select and browse to which location to save the pdf file of a crystal report viewed on a web page, how can i do this in ASP.Net? I need to get the path selected from dialog box. Thanks. Note: Using VS 2002 den2005
1
1174
by: Ashok | last post by:
Hi, I would like to seek your help to get more understanding of how to concert a htm file (with images) to a word or excel file using vb.net programe. Appreciate if anyone can give the code for the above function. Thanks for your suggestion.
3
5213
by: ApexData | last post by:
I am using code from the following links to establish a Browse File and Browse Folder dialog. http://www.mvps.org/access/api/api0001.htm http://www.mvps.org/access/api/api0002.htm This code works great. However, once the file dialog becomes visible, if the user clicks on my popup form that exists under the file dialog, the file dialog disappears under the form. Then, when the form clears, the file dialog shows. Select a file, and...
0
969
by: shabana | last post by:
hi, i wrote a code to display image from a file using adsp imageviewer, Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click AxADspImageViewer1.SourceLocation = IMAGEPLUGINLib.adspImageSourceLocation.sourceLocationFile AxADspImageViewer1.PixelFormat = IMAGEPLUGINLib.adspImagePixelFormat.pixelYuy2
3
3005
by: prashantdixit | last post by:
Hi, I have a form "FormA" which three browse button and texbox control. There two radio buttons at the top with option option1: Auto option2: Manual These option decides how to select a file through Browse dialog button
1
2783
by: mayankshri | last post by:
hi, I am open a word file from open dialog box in rich text box. i am using this code it open a word file but shows only text .i want to open file with text,images and bullets. Microsoft.Office.Interop.Word.ApplicationClass wordObject = new Microsoft.Office.Interop.Word.ApplicationClass(); object File = txtfilepath.Text; //this is the path object nullobject = System.Reflection.Missing.Value; ...
0
8465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8383
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8894
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8803
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8587
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8658
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2029
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1787
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.