更新时间:2023-12-03 12:14:16
有两种可能的方法来实现:
There's 2 possible ways to achieve that:
SELECT <<list_of_columns>>
FROM Studentsgrade
WHERE [Student Name] LIKE @name OR [ID No] LIKE @id OR [Group] LIKE @grp OR [C1] LIKE @c1 OR [C2] LIKE @c2
并将您在 where
子句中定义的参数数量传递给 OleDbCommand.Parameters [ ^ ]集合。
能够将数据加载到DataTable [ ^ ]你必须使用 OleDbReader [ ^ ]通过 OleDbCommand.ExecuteReader()方法 [ ^ ]。br $>
and pass the number of arguments you define in where
clause to OleDbCommand.Parameters[^] collection.
To be able to load data to DataTable[^] you have to use OleDbReader[^] through the OleDbCommand.ExecuteReader() method[^].
详情请参阅:
OleDbParameterCollection.AddWithValue Method(String,Object)(System.Data.OleDb) [ ^ ]
Visual Basic中的LINQ简介 [ ^ ]
LINQ to DataSet示例 [ ^ ]
从查询(LINQ到DataSet)创建DataTable [ ^ ]
LINQ to DataSet中的查询 [ ^ ]
For further details, please read:
OleDbParameterCollection.AddWithValue Method (String, Object) (System.Data.OleDb)[^]
Introduction to LINQ in Visual Basic[^]
LINQ to DataSet Examples[^]
Creating a DataTable From a Query (LINQ to DataSet)[^]
Queries in LINQ to DataSet[^]