我有一个按钮点击事件的以下代码,我为报告打开一个新的选项卡,我需要从后面的代码传递一个参数,
String classname = txt_classname.SelectedValue;
String teachername = "Some name";
string url = "Report_Classwise.aspx";
string s = "window.open('" + url + "', 'popup_window', 'width=300,height=100,left=100,top=100,resizable=yes');";
ClientScript.RegisterStartupScript(this.GetType(), "script", s, true);
Run Code Online (Sandbox Code Playgroud)
我需要将classname&teachername传递给Report_Classwise.aspx页面,我已经尝试过设置
string url = "Report_Classwise.aspx?classname='"+classname+"'&teachername='"+teachername+"'";
Run Code Online (Sandbox Code Playgroud)
但它没有用
我在我的一个程序中有以下IF条件,我设置条件来验证强制文本字段是否为空,如果是,则显示错误消息,但即使必填字段为空,仍然保存记录而不管必须填写.
if (!txt_teacherid.Equals(null) && !txt_teacherid.Equals("") && !txt_teacherfname.Equals(null) && !txt_teacherfname.Equals("") && !txt_teacherlname.Equals(null) && !txt_teacherlname.Equals("") && !txt_teacherdob.Equals(null) && !txt_teacherdob.Equals("") && !txt_teachernationality.Equals(null) && !txt_teachernationality.Equals("") && !txt_teacheraddress.Equals(null) && !txt_teacheraddress.Equals(""))
{
String teacherid = txt_teacherid.Text.Trim();
String teacherfname = txt_teacherfname.Text.Trim();
String teacherlname = txt_teacherlname.Text.Trim();
String teachergender = opt_gender.SelectedItem.Value.ToString();
String teachercivilstatus = opt_civilstatus.SelectedItem.Value.ToString();
String teacherdob = txt_teacherdob.Text.Trim();
String teachernationality = txt_teachernationality.Text.Trim();
String teacheraddress = txt_teacheraddress.Text.Trim();
String teachercontactno = txt_teachercontactno.Text.Trim();
String teacherqualification = txt_teacherqualification.Text.Trim();
String teacherexperience = txt_teacherexperience.Text.Trim();
String teacherjobtitle = txt_teacherjobtitle.Text.Trim();
String teacherjoindate = txt_teacherjoindate.Text.Trim();
String imgpath …Run Code Online (Sandbox Code Playgroud) 我需要在以下SELECT查询的结果中将"payment"表的"payment_status"列更新为"1",但在单个Query中.请帮我.
SELECT * FROM payments p
INNER JOIN invoice i
ON i.invoice_number = p.invoiceGRN_id
WHERE i.invoice_status = '2' AND i.payment_type = 'Credit'
Run Code Online (Sandbox Code Playgroud) 我想从我的发票表中检索最大发票号,当我选择所有可以清楚地看到最大发票号为"10"的记录时,它返回以下内容.
select * from invoice
Run Code Online (Sandbox Code Playgroud)

但是当我查询
select MAX(invoice_number) as maxinv from invoice
Run Code Online (Sandbox Code Playgroud)
它返回"9".这是为什么?

我想打破一个其他条件,如果它有一个内部if条件,如果内部if条件内部变为如下,请建议我一个方法.
if(condition1=true){
}
else if(condition2=true){
if(condition3=true){
do activity 1;
//I want to break here if condition3 is true, without executing activity 2 & 3
}
do activity 2;
do activity 3;
}
Run Code Online (Sandbox Code Playgroud)