Light Silver プロジェクトから読み取ったデータ量はDatagrid1.SelectedItems
問題ありませんが、サーバーでアプリケーションを実行すると、次のエラーが発生します。
メソッド 'Microsoft.VisualBasic.CompilerServices.Symbols+Container.InvokeMethod(Method, System.Object[], Boolean[], System.Reflection.BindingFlags)' でメソッド 'VB$AnonymousType_9
6<System.__Canon,System.__Canon,System.Nullable
1,System.Nullable`1,にアクセスしようとしています。 System.Int32,System.__Canon>.get_Contacts_Name()' が失敗しました。
私のコードは:
見出し
Private Sub LoadDataGridItems(sender As Object, e As EventArgs)
Try
Dim linq = (From n In ds.tbl_PHContacts Where n.Contacts_Name.ToString.Trim.Contains(txtContactName.Text) And n.Contacts_Location.ToString.Trim.Contains(txtLocation.Text) And n.Contacts_OfficeID.Equals(My_Class.CurrentUserOfficeId) Select New With { _
.Contacts_Name = n.Contacts_Name, _
.Contacts_Location = n.Contacts_Location, _
.Contacts_IsPrivate = n.Contacts_IsPrivate, _
.Contacts_IsPersonalize = n.Contacts_IsPersonalize, _
.Contacts_ID = n.Contacts_ID, _
.Contacts_Image = n.Contacts_Image
})
DataGrid1.DataContext = ds.tbl_PHContacts
DataGrid1.ItemsSource = linq
Catch ex As Exception
MessageBox.Show(ex.Message, "phSearch.LoadDataGridItems", MessageBoxButton.OK)
End Try
End Sub
Private Sub DataGridimgEdit_Click(sender As System.Object, e As System.Windows.Input.MouseButtonEventArgs)
Try
Dim frm As New phRegister
frm.Tag = DataGrid1.SelectedItems(0).[Contacts_ID].ToString
frm.Show()
Catch ex As Exception
MessageBox.Show(ex.Message, "phSearch.DataGridimgEdit_Click", MessageBoxButton.OK)
End Try
End Sub