borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (datagrid column width)Next Topic (install VB.NET) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : HELP!!! PLEASE!!Estate Agenst system
Poster Message
zee
Level: Trainee

Registered: 12-02-2006
Posts: 2

icon HELP!!! PLEASE!!Estate Agenst system

hi, i am building a system on estate agents.
  
1)i dont know how to save images with the actual property detail (the property detail is filled in one form and saved in "propertydetails" file, and the images are supposed to be saved in another form in the file "property images" with the propertyID from property details file)

2) i have another form which allows me to search for a property . >>>> now the property image should also be diaplyed with the details when a matching search is found.


thats it for now if someone can help me i would really apprecite it ( and send u flowers.lol)

12-02-2006 at 12:51 AM
View Profile Send Email to User Show All Posts | Quote Reply
TJ_01
Level: VB Lord


Registered: 24-08-2005
Posts: 320
icon Re: HELP!!! PLEASE!!Estate Agenst system

Hi zee.

1. I suggest you put or store all the picture in a certain folder.
if your using vb.net your code must be similar to this one

Dim Img as Image = Image.FromFile("C:\" & TextBox1.Text & ".jpg")
Picturebox1.Image = Img


Note: You can change the value of C:\ depends on where the picture file resides and also .JPG (Extension filename such as .GIF, .BMP and so on..)

2. Assuming that you make a query to you database;

da.Fill = (ds, "TblName")

If ds.Tables("TblName").Rows.Count = 0 then
    Messagebox.Show ("No Record Found")
Else
    TextBox1.Text = ds.Tables("TblName").Rows(0).Item("fieldName")

'Then you find your picture file

Dim Img as Image = Image.FromFile("C:\" & TextBox1.Text & ".jpg")
Picturebox1.Image = Img

End If

This is air coded but hope this helps  

____________________________
Im JAMES  

16-02-2006 at 05:38 AM
View Profile Send Email to User Show All Posts | Quote Reply
zee
Level: Trainee

Registered: 12-02-2006
Posts: 2
icon Re:Code that i have used .....it doesnt work

Dim found As Boolean
    Dim imagepath As String
    Dim index As Integer
    Dim filename As String
    Dim numberofrecords As Integer
    Dim onepropertyimages As PropertyImages
    Dim onepropertydetail As PropertyType
    Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
        Dim FileName As String
        OpenFileDialog1.Filter = " Bitmaps (*.bmp)|*.bmp"
        If OpenFileDialog1.ShowDialog = DialogResult.OK Then
            PictureBox1.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
            'OpenFileDialog1.ShowDialog()
            FileName = OpenFileDialog1.FileName
        End If
        imagepath = imagepath & FileName
    End Sub
    Private Sub MenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
        Dim FileName As String
        'OpenFileDialog1.ShowDialog()
        OpenFileDialog1.Filter = " Bitmaps (*.bmp)|*.bmp"
        If OpenFileDialog1.ShowDialog = DialogResult.OK Then
            PictureBox2.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
            'OpenFileDialog1.ShowDialog()
            FileName = OpenFileDialog1.FileName
        End If
        imagepath = imagepath & FileName

    End Sub
    Private Sub MenuItem4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem4.Click
        Dim FileName As String
        'OpenFileDialog1.ShowDialog()
        OpenFileDialog1.Filter = " Bitmaps (*.bmp)|*.bmp" '(*.jpeg)
        If OpenFileDialog1.ShowDialog = DialogResult.OK Then
            PictureBox3.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
            'OpenFileDialog1.ShowDialog()
            FileName = OpenFileDialog1.FileName
        End If
        imagepath = imagepath & FileName
    End Sub
    Private Sub MenuItem5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem5.Click
        Dim FileName As String
        'OpenFileDialog1.ShowDialog()
        OpenFileDialog1.Filter = " Bitmaps (*.bmp)|*.bmp"
        If OpenFileDialog1.ShowDialog = DialogResult.OK Then
            PictureBox4.Image = System.Drawing.Image.FromFile(OpenFileDialog1.FileName)
            'OpenFileDialog1.ShowDialog()
            FileName = OpenFileDialog1.FileName
        End If
        imagepath = imagepath & FileName
    End Sub
    Private Sub mnusave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnusave.Click
       Dim Img As Image = Image.FromFile("F:\" & TextBox1.Text & ".jpg")>>>>>This is where the images are 'F:\Royel Estates\Zeenat Prototyping\Images
        PictureBox1.Image = Img



        Dim houseID As String
        Dim onepropertyimages As PropertyImagesType
        filename = "PropertyImages.dat"
        FileOpen(4, filename, OpenMode.Random, , , Len(onepropertyimages))
        numberofrecords = LOF(4) / Len(onepropertyimages)
        With onepropertyimages
            .imageID = numberofrecords + 1
            .HouseID = cboHouseID.Text
            .filepath = imagepath
        End With
        MsgBox("Saved")
        'FileOpen(4, filename, OpenMode.Random, , , Len(onepropertyimages))
        'FilePut(4, onepropertyimages, numberofrecords + 1)
        'FileClose(4)
        ' numberofrecords = numberofrecords + 1


        '*************************************************************************************************
    End Sub
    Private Sub PropertyImages_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'Dim onepropertyimages As PropertyImages
        'filename = "PropertyImages.dat"
        'FileOpen(4, filename, OpenMode.Random, , , Len(onepropertyimages))
        'numberofrecords = LOF(4) / Len(onepropertyimages)
        'FileClose(4)
        '**********************************************************************************************************
        Dim imagepath As String
        imagepath = CurDir() & "\Filename"
        '**********************************************************************************************************
        filename = "Propertydetails.dat"
        FileOpen(2, filename, OpenMode.Random, , , Len(onepropertydetail))
        numberofrecords = LOF(2) / Len(onepropertydetail)
        For index = 1 To numberofrecords
            FileGet(2, onepropertydetail, index)
            cboHouseID.Items.Add(onepropertydetail.HouseID)
        Next
        FileClose(2)

18-02-2006 at 10:15 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : VB.Net : HELP!!! PLEASE!!Estate Agenst system
Previous Topic (datagrid column width)Next Topic (install VB.NET) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder