我现在用vb.net中的asp.net web 应用程序写程序,但是不会写查询语句了,请指教。
我要实现的查询是这样的:一个DropDownList1控件,在里面添加了内容,一个TextBox1控件,为用户输入条件。如何写查询语句?
数据库里的字段是英文的,DropDownList1控件里添加的内容是中文的,如何转换?谢谢大家!!!

解决方案 »

  1.   

    select lie as 中文 from table where lie=""
      

  2.   

    简单的问题 …… 
    数据库里的字段是英文的,DropDownList1控件里添加的内容是中文的,如何转换?
    这个难道要挂个翻译引擎 ??
      

  3.   

    "Select * From Table Where 字段名 like '" + DropDownList1.SelectedValue + "' and " + TextBox1.Text;
      

  4.   

    dim SQL as string
    SQL="select lie as 中文 from table where lie='" & textbox1.text.trim & "'"
      

  5.   

    string sqlstring="select filename from table where filedname='"+TextBox1.Text"'";
      

  6.   

    除了SQL语句,之后呢,执行语句呢?
      

  7.   

    Select DropDownList1.selectedindex
        Case 0
            Select * From Table Where 英文字段名1 + textbox1.text
        Case 1
            Select * From Table Where 英文字段名2 + textbox1.text
        Case 2
            Select * From Table Where 英文字段名3 + textbox1.text
        Case 3
            Select * From Table Where 英文字段名4 + textbox1.text
    end select不要理dropdownlist的中文Value.