使用C#操作Access参数形式的模糊查询方法

代码记录一下:

1public static DataTable getByName(string typeName)
 2        {
 3            StringBuilder sb = new StringBuilder();
 4            sb.Append("select * from type1 where typeName like @typeName");
 5            OleDbParameter[] param =
 6            {
 7                OleDbHelper.GetParameter("@typeName",OleDbType.VarChar,50,"[typeName]","%"+typeName+"%")
 8            };
 9            return OleDbHelper.ExecuteDt(sb.ToString(), param);
10        }

     

posted on 2012-03-15 20:32  h2内存数据库  阅读(291)  评论(0编辑  收藏  举报

导航