1ページに2つのパネルがあります(SAPInfo、OSInfo)。SAPInfoパネルには、3つのテキストボックス(SID、Client、User_id)と1つの検索ボタンがあります。[検索]ボタンをクリックした後、次のページのグリッドビューにSAPテーブル(user_id、Descriptio、sap_system_password)のデータを表示したいと思います。同様に、OSInfoパネルには、2つのテキストボックス(IP / HostName、User_id)と1つの検索ボタンがあります。[検索]ボタンをクリックした後、同じグリッドビューにOSテーブル(user_id、Descriptio、os_system_password)のデータを表示したいと思います。Gridviewには4つの列(UserID、Description、Password、Change Password)がありますSAPテーブルにはフィールドが含まれていますas(sid、client_no、user_id、sap_system_password、description)OSテーブルにはフィールドが含まれていますas(user_id、ip、host_name、os_system_password、description)これ?助けてください..これは私の検索ボタン(SAP)コードです
protected void btnSAPSearch_Click(object sender, EventArgs e)
{
try
{
using (MySqlConnection conn = new MySqlConnection(clsUser.connStr))
{
conn.Open();
string strQuery = "select DISTINCT user_id,description,sap_system_password from sap_password_info where user_id is not null";
if (txtSid.Text !="")
{
strQuery += " AND sid = '" + txtSid.Text + "'";
}
if (txtClient.Text != "")
{
strQuery += " AND client_no = '" + txtClient.Text + "'";
}
if (txtUser.Text != "")
{
strQuery += " AND user_id = '" + txtUser.Text + "'";
}
MySqlCommand cmd = new MySqlCommand(strQuery, conn);
DataTable dt = new DataTable();
dt.Load(cmd.ExecuteReader(CommandBehavior.CloseConnection));
Session["userinfo"] = dt;
Response.Redirect("~\\PasswordInformation_Details.aspx");
}
}
catch (Exception ex)
{
//lblMessage.Text = DataObjects.Error_Message();
lblMsg.Text = ex.Message.ToString();
}
}