Talking about NULLABLE datagridviewcomboboxcolumn (vbnet 2005)

 
 
Unresolved
Untried
How to allow used to remove an entry from a DataGridViewComboBoxColumn
 
Possibly try
 
 

Forms Designer does not show: Value does not fall within the range expected

 
Very frustrating bug this one.
May be that the .resx file is corrupt. In particular the "Other" section, which is the tray locations
 
A way of getting the form back is to close Visual Studio and then reopen
 
Have not tried this.
 
This suggests
1. Go to Windows Explorer and make a copy of the bad forms .RESX file.
2. In the Solution Explorer, click the Show All Files button.
3. Your form should have a + beside it.  Click it and the .resx should show. Make a copy of the .resx file.
4. Right click on the .resx and delete it.
5. Close the IDE.
6. Restart VS and load your project, the .resx should be ok.
 
 

Report Data Sources

 
When designing a report there is an extra top menu. So use Report > Data Sources.
Ideally DataSource is in same project. Possibly use Objects in future if not in same project. Seems awkward.
 
Error "The source of the report definition has not been specified"
 
Dim ds As New dsA
Dim ta As New dsATableAdapters.ATableAdapter
ta.Fill(ds.A)
Dim bs As New Windows.Forms.BindingSource(ds, ds.A.TableName)
 
Dim ReportDataSource1 As ReportDataSource = New ReportDataSource
ReportDataSource1.Name = "dsA_A"    'Important to use datasource name as used on report
ReportDataSource1.Value = bs
 
With Me.ReportViewer1.LocalReport
    .DataSources.Add(ReportDataSource1)
    .DataSources(0).Value = bs
End With
 

Edit and Continue: Changes are not allowed when the debugger has…

 
Edit and Continue
Changes are not allowed when the debugger has been attached to an already running process or the code being debugged was optimized at build or run time
 
Probably more than one issue:
  1. Check that running in Debug mode

 

VB6 Add-Ins E.g. Class Builder

 
Normally located here:
      C:\Program Files\Microsoft Visual Studio\VB98\Wizards\
Then
      CLSSBLD.DLL
 
Run regsvr32.exe on these
 
API Viewer is in there somewhere
 

Object Oriented – OO – Visual Basic 6 Specifics – VB6

 
 
The word "Set" is often required. Omitting this in the following would compile but go through the Get routine instead and error in runtime.
 
Private Sub Class_Initialize()
    Set Me.Employee = New Employee
End Sub
 
 
In loops there are two options
Either Dim object as New instance inside loop. Then set to Nothing before next loop.
Do Until rsTD.EOF
Dim cTimeSheet As New clsTimeSheet
cTimeSheet.Employee.EmpeeNo = rsTD!EmpeeNo
Call cJS.colTimeSheets.AddTimeSheet(cTimeSheet, lngMaxEmp)

Set cTimeSheet = Nothing

rsTD.MoveNext
Loop

Or following with or without first New
Dim cTimeSheet As New clsTimeSheet

Do Until rsTD.EOF
Set cTimeSheet = New clsTimeSheet
cTimeSheet.Employee.EmpeeNo = rsTD!EmpeeNo
Call cJS.colTimeSheets.AddTimeSheet(cTimeSheet, lngMaxEmp)

rsTD.MoveNext
Loop

 
 
 
 
 
 
 

WPF Format Date in ListView

 
I am very new to WPF. So here goes:

<GridViewColumn Header=“Date Input” Width=“150”>
<GridViewColumn.CellTemplate >
<DataTemplate >
<TextBox Text=“{Binding Path=DateInput, StringFormat=’dd-MMM-yy’}” />
</DataTemplate>
</GridViewColumn.CellTemplate></GridViewColumn>

 
Good article here…
 
 
 
 
 

Find Text in File

Technorati Tags: ,
 

Private Function IsTextInFile(ByVal MyDir As String, ByVal TextToFind As String, ByVal MyFileWildcard As String) As Boolean

Dim list As System.Collections.ObjectModel.ReadOnlyCollection(Of String)
list =
My.Computer.FileSystem.FindInFiles(MyDir, TextToFind, True, FileIO.SearchOption.SearchTopLevelOnly, MyFileWildcard)

If list.Count = 1 Then
IsTextInFile = True
End If

End Function

Search Crystal Reports in Visual Studio for table/procedures

 
 
This is a part of the VB proc I built to generates the list of all tables used by my reports. Reports are listed in a ‘reports Table’, and I use a memo field to store the name of all used tables. It is then quite easy to update all requested reports once tables have been modified.
Publicfunction tablesUsedByAReport(myReportName asstring)asstringDim m_report As CRAXDRT.Report, _      m_crystal As CRAXDRT.Application, _      m_tablesUsedByAReport AsStringDim m_table As CRAXDRT.DatabaseTable, _      m_section As CRAXDRT.section, _      m_objet AsObject, _      m_subReport As CRAXDRT.SubreportObjectSet m_crystal =New CRAXDRT.ApplicationSet m_rapport = m_crystal.OpenReport(m_nomRapport,1)'table names in the report'ForEach m_table In m_rapport.Database.tables    m_tablesUsedByAReport = m_tablesUsedByAReport & m_table.location &";"Next m_table 'table names in each of the subreports'ForEach m_section In m_rapport.Sections    ForEach m_objet In m_section.ReportObjects        If m_objet.Kind= crSubreportObject Then            Set m_subReport = m_objet            Set m_report = m_subReport.OpenSubreport            ForEach m_table In m_rapport.Database.tables                m_tablesUsedByAReport = m_tablesUsedByAReport & m_table.location &";"           Next m_table        EndIf    Next m_objetNext m_section 'my tables list'tablesUsedByAReport = m_tablesUsedByAReport Endfunction

 

Speed Up ToolBox Opening

 
Change setting
Tools > Options > Windows Forms Designer > ToolBox > AutoToolBoxPopulate
From True to False