access的传参模糊查询 - .NET技术 / ASP.NET
string sql = "select * from [order] where @type like '%@keyword%'";
OleDbParameter[] paras = new OleDbParameter[]
{
new OleDbParameter("@type",type),
new OleDbParameter("@keyword",keyword)
};
这样查不出数据 搜索一番找到一个解决方法 即将'%@keyword%' 改为 '%'+@keyword+'%' 依然查不出数据- -! 于是将@type改成拼接的。。。就可以查到数据了,为什么? 不能同时传两个参数吗?
目前用的有效写法
string sql = "select * from [order] where "+type+" like '%'+@keyword+'%'";
OleDbParameter[] paras = new OleDbParameter[]
{
new OleDbParameter("@keyword",keyword)
};
string sql = "select * from [order] where "+type+" like '%@keyword%'";
这样就行了系统会自动判断@的
C# code:
string sql = "select * from [order] where "+type+" like '%@keyword%'";
这样就行了系统会自动判断@的
就是这样.
不行的 现在数据库是ACCESS的! 不是SQL SERVER 。
现在有个想法,在网上找说ACCESS是不支持多语句执行和注释的,那是不是就不怕注入了。。?
拼接才可以
hehe~`````
相关问答:
C# code:
SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
就是一个按钮,点击之后打开对话框,然后选取图片。就这样上传。。
怎么实现。在网上搜到那么多的代码,全是很多的那种,不知道,看不下去。
所以在这里想请大哥大姐帮帮忙。
使用自带的fileupload控件可以实现 ......
怎样将ASP程序转换为.NET程序 ?
找个全才翻译。
手动去写
感觉写过asp的,来写asp.net,上手应该快点。
更能理解asp.net的一些内部技术
asp.net都被封装了
我是做.Net的,对ASP一直没接触到,很陌生。
公 ......
C# code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Runtime.InteropServices;
nam ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......