当前位置:数据库 > Access >>

使用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        }

    
补充:软件开发 , C# ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,