を使用しdatagridview
て生徒の記録を表示しています。
ホステラーの生年月日でフィルタリングされたレコードを表示したい。
datetimepicker
カスタム形式を使用してから 11/09 を選択してデータを検索するdd/mm
と、何も表示されません。
年を無視して dd/mm のみを一致させてすべてのレコードを表示するにはどうすればよいですか?
これが私のコードです:
Try
con = New OleDbConnection(cs)
con.Open()
cmd = New OleDbCommand("SELECT HostelerID as [Hosteler ID],HostelerName as [Hosteler Name],DOB,HostelName as [Hostel Name],RoomNo as [Room No],DateOfJoining as [Date Of Joining],Purpose,FatherName as [Father's Name],MobNo1 as [Mobile No],Phone1 as [Phone No],MotherName as [Mother's Name],MobNo2 as [Mobile No 2],City,Address,Email,ContactNo as [Contact No],InstOfcDetails as [Ins/Ofc Details],Phone2 as [Phone No 2],Agreement,GuardianName as [Guardian Name],GuardianAddress as [Guardian Address],MobNo3 as [Guardian Mobile No],Phone3 as [Guardian Phone No],FixedDeposit as [Fixed Deposit],CompletionDate as [Completion Date],Photo,DocsPic as [Docs Pic] from Hostelers where DOB like #" & DateTimePicker1.Text & "# order by HostelerName", con)
Dim myDA As OleDbDataAdapter = New OleDbDataAdapter(cmd)
Dim myDataSet As DataSet = New DataSet()
myDA.Fill(myDataSet, "Hostelers")
DataGridView6.DataSource = myDataSet.Tables("Hostelers").DefaultView
con.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try