Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 2 commits
  • 4 files changed
  • 0 comments
  • 2 contributors
7 ICS Assignment/My Project/Settings.Designer.vb
... ... @@ -1,7 +1,7 @@
1 1 '------------------------------------------------------------------------------
2 2 ' <auto-generated>
3 3 ' This code was generated by a tool.
4   -' Runtime Version:4.0.30319.261
  4 +' Runtime Version:4.0.30319.530
5 5 '
6 6 ' Changes to this file may cause incorrect behavior and will be lost if
7 7 ' the code is regenerated.
@@ -57,8 +57,9 @@ Namespace My
57 57 <Global.System.Configuration.ApplicationScopedSettingAttribute(), _
58 58 Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
59 59 Global.System.Configuration.SpecialSettingAttribute(Global.System.Configuration.SpecialSetting.ConnectionString), _
60   - Global.System.Configuration.DefaultSettingValueAttribute("Server=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial C"& _
61   - "atalog=MyTestDB;Data Source=(local);")> _
  60 + Global.System.Configuration.DefaultSettingValueAttribute("Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL1"& _
  61 + "0_50.SQLEXPRESS\MSSQL\DATA\MyTestDB.mdf;Database=MyTestDB; Trusted_Connection=Ye"& _
  62 + "s;")> _
62 63 Public ReadOnly Property dbConnectorString() As String
63 64 Get
64 65 Return CType(Me("dbConnectorString"),String)
4 ICS Assignment/My Project/Settings.settings
@@ -5,10 +5,10 @@
5 5 <Setting Name="dbConnectorString" Type="(Connection string)" Scope="Application">
6 6 <DesignTimeValue Profile="(Default)">&lt;?xml version="1.0" encoding="utf-16"?&gt;
7 7 &lt;SerializableConnectionString xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
8   - &lt;ConnectionString&gt;Server=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyTestDB;Data Source=(local);&lt;/ConnectionString&gt;
  8 + &lt;ConnectionString&gt;Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\MyTestDB.mdf;Database=MyTestDB; Trusted_Connection=Yes;&lt;/ConnectionString&gt;
9 9 &lt;ProviderName&gt;Microsoft.SqlServerCe.Client.3.5&lt;/ProviderName&gt;
10 10 &lt;/SerializableConnectionString&gt;</DesignTimeValue>
11   - <Value Profile="(Default)">Server=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyTestDB;Data Source=(local);</Value>
  11 + <Value Profile="(Default)">Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\MyTestDB.mdf;Database=MyTestDB; Trusted_Connection=Yes;</Value>
12 12 </Setting>
13 13 </Settings>
14 14 </SettingsFile>
2  ICS Assignment/app.config
@@ -4,7 +4,7 @@
4 4 </configSections>
5 5 <connectionStrings>
6 6 <add name="WindowsApplication1.My.MySettings.dbConnectorString"
7   - connectionString="Server=SQLNCLI10.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MyTestDB;Data Source=(local);"
  7 + connectionString="Server=.\SQLExpress;AttachDbFilename=C:\Program Files\Microsoft SQL Server\MSSQL10_50.SQLEXPRESS\MSSQL\DATA\MyTestDB.mdf;Database=MyTestDB; Trusted_Connection=Yes;"
8 8 providerName="Microsoft.SqlServerCe.Client.3.5" />
9 9 </connectionStrings>
10 10 <system.diagnostics>
26 ICS Assignment/frmFindProperties.vb
@@ -32,7 +32,7 @@ Public Class frmFindProperties
32 32 End Sub
33 33
34 34
35   - Private Sub dgvProperties_CellContentClick(sender As System.Object, e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvProperties.CellContentClick
  35 + Private Sub dgvProperties_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dgvProperties.CellClick
36 36 With dgvProperties
37 37 Dim r As Integer = e.RowIndex
38 38 .Rows(r).Selected = True ' select the entire row
@@ -46,6 +46,7 @@ Public Class frmFindProperties
46 46 End Sub
47 47 Sub fillDetails()
48 48 prop.loadProperty(Properties.propid)
  49 +
49 50 With prop
50 51 txtAdd1.Text = .add1
51 52 txtAdd2.Text = .add2
@@ -54,7 +55,16 @@ Public Class frmFindProperties
54 55 rtbDescription.Text = .description
55 56 txtStatus.Text = .status
56 57 txtPrice.Text = .price
57   - pbxPhoto.Image = .photo
  58 + prop.imageSource = "c:\img\" & Properties.propid & ".jpg"
  59 + With My.Computer.FileSystem
  60 +
  61 + If .FileExists(prop.imageSource) Then
  62 + pbxPhoto.Load(prop.imageSource)
  63 +
  64 + Else
  65 + pbxPhoto.Image = Nothing
  66 + End If
  67 + End With
58 68
59 69 End With
60 70
@@ -64,9 +74,19 @@ Public Class frmFindProperties
64 74 Dim d As New OpenFileDialog()
65 75 Dim s As String
66 76 d.InitialDirectory = "E:\ICS\houses"
67   - s = d.ShowDialog()
  77 + d.ShowDialog()
68 78 s = d.FileName
  79 + prop.imageSource = "c:\img\" & Properties.propid & ".jpg"
69 80 pbxPhoto.Load(s)
  81 + FileCopy(s, prop.imageSource)
  82 + With My.Computer.FileSystem
  83 + If .FileExists(d.FileName) Then
  84 +
  85 + pbxPhoto.Load()
  86 + Else
  87 +
  88 + End If
  89 + End With
70 90
71 91
72 92 End Sub

No commit comments for this range

Something went wrong with that request. Please try again.