{
System.Collections.Generic.List<Teleplay> list = new System.Collections.Generic.List<Teleplay>();
con.Open();
using (OleDbCommand com = new OleDbCommand("select * from [Cartoon] where [C_Name] like '%' + ? + '%'", con))
{
com.Parameters.Add("?", OleDbType.VarChar).Value = name;
var reader = com.ExecuteReader();
while (reader.Read())
{
list.Add(new Teleplay()
{
Name = (string)reader["C_Name"],
Number = (int)reader["C_Number"],
Date = (reader["C_Date"] is System.DBNull ? null : (DateTime?)reader["C_Date"]),
Note = (reader["C_Note"] is System.DBNull ? "" : (string)reader["C_Note"]),
IsFinish = (bool)reader["C_IsFinish"]
});
}
return list.ToArray();
}
}