ASP.NET查詢問題(高手請進)
要做兩個關聯表的查詢:
表一:SFCYML
字段:ML001(單別)、ML002(單號)、ML005(工單單別)、ML006(工單單號)、ML015(品號)、ML011(投入批號)、ML012(產出批號)、ML016(總長)、ML017(各段長)、ML052(幅寬)、ML007(類別)、ML001(單別);
表二:MOCTA
字段:TA001、TA002、UDF01(客戶)
兩表關系:ML005和TA001關聯;ML006和TA002關聯
要實現用戶通過輸入品号(品號)或產出批號(ML012)或工單單號(ML006)
查詢.
要顯示的信息為:單別、單號、工單單別、工單單號、品號、投入批號、產出批號、總長、各段長、幅寬、類別、單別、客戶.
全部顯示我已實現,請問怎麼實現查詢???
search.aspx:
Language= "C# " AutoEventWireup= "true " CodeFile= "Default.aspx.cs " EnableEventValidation = "false " Inherits= "UI_Default " %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<html xmlns= "http://www.w3.org/1999/xhtml " >
<head id= "Head1 " runat= "server ">
<title> 无标题页 </title>
<link href= "../StyleSheet.css " rel=Stylesheet type= "text/css " />
</head>
<body>
<center>
<form id= "form1 " runat= "server ">
<div>
<asp:Panel ID= "Panel1 " runat= "server " Height= "23px " Width= "850px ">
<asp:Label ID= "Label1 " runat= "server " Text= "查詢條件: " ForeColor= "#666666 "> </asp:Label>
<asp:DropDownList ID= "DropDownList1 " runat= "server " Font-Names= "宋体 " Font-Size= "9pt ">
<asp:ListItem Value= "ML015 "> 品號 </asp:ListItem>
<asp:ListItem Value= "ML011 "> 投入批號 </asp:ListItem>
<asp:ListItem Value= "ML012 "> 產出批號 </asp:ListItem>
<asp:ListItem Value= "Ml006 "> 工單單號 </asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID= "DropDownList2 " runat= "server " Font-Names= "宋体 " Font-Size= "9pt ">
</asp:DropDownList>
<asp:TextBox ID= "TextBox1 " runat= "server " Height= "13px &qu