Мне нужно привязать поле (ComputerTag) к текстовому полю.Как связать поле с текстовым полем
Это мой код:
public void load()
{
//Intializing sql statement
string sqlStatement = "SELECT Computertag FROM Computer WHER
[email protected]";
SqlCommand comm = new SqlCommand();
comm.CommandText = sqlStatement;
int computerID = int.Parse(Request.QueryString["ComputerID"]);
//get database connection from Ideal_dataAccess class
SqlConnection connection = Ideal_DataAccess.getConnection();
comm.Connection = connection;
comm.Parameters.AddWithValue("@ComputerID", computerID);
try
{
connection.Open();
comm.ExecuteNonQuery();
//Bind the computer tag value to the txtBxCompTag Text box
txtBxCompTag.Text= string.Format("<%# Bind(\"{0}\") %>", "Computertag");
}
catch (Exception ex)
{
Utilities.LogError(ex);
throw ex;
}
finally
{
connection.Close();
}
}
но "txtBxCompTag.Text = string.Format (" <% # Bind (\ "{0} \")%> " "Computertag");" эта строка кода не привязывает значение к текстовому полю. Как назначить значение в текстовое поле?
Спасибо, как новичок ур Xample помог. – Sas