Mam takie pytanie co zrobić żeby do polecenia SELECT dodać warunek np. WHERE idgatunku=..... (włąśnie tu chcę dać TextBox) z którego po wpisaniu do tego pola będzie zwracana wartość do warunku.W kodzie jest wpisana wartość sztywna 1 Proszę o pomoc bo nie wiem jak to zapisać. Z góry dzięki
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Import Namespace="System.Data.OleDb" %>
<!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 runat="server">
<title>Untitled Page</title>
</head>
<body>
<%
string conString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+ Server.MapPath("App_Data\\4.mdb");
OleDbConnection oConn=new OleDbConnection(conString);
oConn.Open();
OleDbCommand oCom = new OleDbCommand("SELECT * FROM Stal Where Idgatunku=1 ORDER BY idStali", oConn);
OleDbDataReader drzbiornik = oCom.ExecuteReader();
Response.Write("<table border=\"1\">");
Response.Write("<tr><td>id</td><td>Oznaczenie</td><td>Re</td><td>Rm</td><td>Idgatunku</td><td>Idproducenta</td></tr>");
while (drzbiornik.Read())
{
Response.Write("<tr>");
Response.Write("<td>" + drzbiornik["idstali"] + "</td>");
Response.Write("<td>" + drzbiornik["oznaczenie"] + "</td>");
Response.Write("<td>" + drzbiornik["Re"] + "</td>");
Response.Write("<td>" + drzbiornik["Rm"] + "</td>");
Response.Write("<td>" + drzbiornik["idgatunku"] + "</td>");
Response.Write("<td>" + drzbiornik["idproducenta"] + "</td>");
Response.Write("<td><input type=\"button\" value=\"Edytuj\" onClick=\"pola.id_edit.value=" + drzbiornik["idStali"] + ";pola.submit();\"></td>");
Response.Write("<td><input type=\"button\" value=\"Usuń\" onClick=\"form1.id_del.value=" + drzbiornik["idStali"] + ";form1.submit();\"></td>");
Response.Write("</tr>");
}
Response.Write("</table>");
oConn.Close();
%>
</form>
</body>
</html>