Dim con1 As OleDb.OleDbConnection
Dim cmd As OleDb.OleDbCommand
Dim query As String
Dim rs As OleDb.OleDbDataReader
con1 = New OleDb.OleDbConnection("Provider=MSDAORA.1;Data Source=localhost;Persist Security Info=True;Password=sys;User ID=nitishok")
con1.Open()
query = "select * from HOLDERSDB where DOB like '" + DateTimePicker1.Value + "' "
cmd = New OleDb.OleDbCommand(query, con1)
cmd.CommandType = CommandType.Text
rs = cmd.ExecuteReader
Dim da As New OleDb.OleDbDataAdapter(query, con1)
Dim ds As New DataSet()
da.Fill(ds, "HOLDERSDB")
DataGridView1.DataSource = ds.Tables(0)
con1.Close()
enter code here
我想要 HOLDERS 表中 DOB 为 datetimepicker1 的行 我发布的代码不返回任何结果。
请帮忙。