Home > Net >  TxtMesrfid. Text. The Trim () is undefined? How be to return a responsibility, introduction, online
TxtMesrfid. Text. The Trim () is undefined? How be to return a responsibility, introduction, online

Time:09-26


String sql2="insert into T_RFID_COMPARE_TP (c_device_name" + ", c_plc_rfid "+", c_mes_rfid "+", c_type "+", c_materiel_id "+", c_materiel_barcode "+", "
c_statesI_deal + ", "+", i_tag) Values (', '" + txtplcrfid. Text. The Trim () + "', '" + txtMesrfid. Text. The Trim () + "', 'TP', '0', '0', ', '0', '0') ";

CodePudding user response:

You where to put this statement (InitializeComponent (); In front of this sentence?

CodePudding user response:

reference 1st floor Bridge_go response:
you where to put this statement (InitializeComponent (); In front of this sentence?
I not InitializeComponent (), it is written in c # web query back-end, txtplcrfid input parameters, is this string

CodePudding user response:

reference 1st floor Bridge_go response:
you where to put this statement (InitializeComponent (); In front of this sentence?
in protected void inside the Button1_Click

CodePudding user response:

Didn't find txtMesrfid text box control, use your code to stick out to see

CodePudding user response:

The
references 4 floor Grey. Jia response:
use, didn't find txtMesrfid text box control, stick your code out to see?

Using System;
Using System. Web. UI. WebControls;
Using System. The Data. SqlClient.
Using System. Web. UI.

Public partial class WebForm1: System. Web. UI. Page
{

Public object PDS {get; Private set; }
//public object com {get; Private set; }

///add the pallet information

(Obsolete)
Protected void Button1_Click (object sender, EventArgs e, object txtMesrfid, object txtplcrfid)
{
///event trigger, the movement caught

String constring="server=172.50.34.20; The database=sbs_2016wms_db_hfwl; User ID=sa; Password=sa!" ;
SqlConnection conn1=new SqlConnection (constring);
Conn1. The Open ();

String sql1="select count (1) the from T_RFID_COMPARE_TP where c_plc_rfid=txtplcrfid and c_mes_rfid=txtMesrfid";
SqlCommand cmd1=new SqlCommand (sql1, conn1);
Int I=the Convert. ToInt32 (cmd1. ExecuteScalar ());
If (I & gt; 0)
{
RegisterStartupScript (enclosing GetType, "alert", "& lt; script> Alert (' tray code already exists!!!!! ') & lt;/script>" );
return;
}
The else
{
String sql2="insert into T_RFID_COMPARE_TP (c_device_name" + ", c_plc_rfid "+", c_mes_rfid "+", c_type "+", c_materiel_id "+", c_materiel_barcode "+", "
c_statesI_deal + ", "+", i_tag) Values (', '" + txtplcrfid. Text. The Trim () + "', '" + txtMesrfid. Text. The Trim () + "', 'TP', '0', '0', ', '0', '0') ";

SqlConnection conn2=new SqlConnection (constring);
Conn2. The Open ();
SqlCommand cmd2=new SqlCommand (sql2, conn2);
Int t=cmd2. ExecuteNonQuery ();
If (t==1)
{
Page. RegisterStartupScript (" alert ", "& lt; script> Alert (' tray information add success!!!!! ') & lt;/script>" );
return;
}
}
Conn1. Close ();
}

Private void RegisterStartupScript (Func GetType, string v1, string v2)
{
Throw new NotImplementedException ();
}

No.///query tray

Public void Button3_Click (object sender, EventArgs e)
{
String constring="server=172.50.34.20; The database=sbs_2016wms_db_hfwl; User ID=sa; Password=sa!" ;
String sql3="SELECT c_id, c_plc_rfid c_mes_rfid FROM T_RFID_COMPARE_TP where c_mes_rfid==txtMesrfid or c_plc_rfid txtplcrfid";
SqlConnection con3=new SqlConnection (constring);
Con3. The Open ();
SqlCommand com3=new SqlCommand (sql3, con3);
While (PDS) Read ())
{
PDS=ExecuteReader ();
DataList2. The DataSource=PDS;
DataList2. DataBind ();
}
Con3. Close ();
}
//private object the Read ()
//{
//throw new NotImplementedException ();
//}
Private object ExecuteReader ()
{
Throw new NotImplementedException ();
}

//delete function
(Obsolete)
Protected void Button2_Click (object sender, EventArgs e)
{
String constring="server=172.50.34.20; The database=sbs_2016wms_db_hfwl; User ID=sa; Password=sa!" ;
String sql4="delete from T_RFID_COMPARE_TP where c_mes_rfid==txtMesrfid or c_plc_rfid txtplcrfid";
SqlConnection con4=new SqlConnection (constring);
Con4. The Open ();
SqlCommand cmd3=new SqlCommand (sql4, con4);
Int I=cmd3. ExecuteNonQuery ();
If (I==0)
{

This Page. RegisterStartupScript (" alert ", "& lt; script> Alert (' tray information deleted successful!!!!! ') & lt;/script>" );
return;
}
Con4. Close ();

}


}

CodePudding user response:

Did you have a look at this file inside the control code (cs) WebForm1. Aspx. Designer.

CodePudding user response:

refer to 6th floor Bridge_go response:
did you have a look at this file inside the control code (cs) WebForm1. Aspx. Designer.
no,,, it should do

CodePudding user response:

Add try inside
Protected the global: : System. Web. UI. WebControls. The TextBox txtMesrfid;

CodePudding user response:

You don't have a defined (txtMesrfid) this class, change to be like this: txtMesrfid. The Trim ();nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  •  Tags:  
  • C#
  • Related