SQL QUERY IN MULTIPLE LINE [英] SQL QUERY IN MULTIPLE LINE

查看:66
本文介绍了SQL QUERY IN MULTIPLE LINE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询,例如

i have a query such as

commandtext = "SELECT * FROM TABLENAME WHERE 1=1 and 1=1 and 1=1

< br $>


i有两个组合框,我想根据组合框中的值来过滤数据。



什么我想要的是

如果我选择组合框1然后我想要代码是



i have two combobox and i want to filter data according to the value available in the combobox.

what i want is
if i choose combobox 1 then i want to the code to be

commandtext = SELECT * FROM TABLENAME WHERE 1=1 and columnvalue = combobox value and 1=1





i想要在执行程序期间替换条件(和1 = 1)



请帮帮我



问候

Bunzitop



i want to replace the conditions (and 1=1) during execution of program

please help me

Regards
Bunzitop

推荐答案

这样做:



So do this:

commandtext = "Select * From TableName Where columnvalue = ''" + combobox.value + "''";


这篇关于SQL QUERY IN MULTIPLE LINE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆