日期:2014-05-17 浏览次数:20941 次
string queryString = select * from 表 where x='" + x.Text + "' and y='"+y.Text+"'";
using (SqlConnection connection = new SqlConnection( connectionString))
{
SqlCommand command = new SqlCommand( queryString, connection);
connection.Open();
SqlDataReader reader = command.ExecuteReader();
try
{
while (reader.Read())
{
richtextbox.Text=reader[0].ToString();
}
}
finally
{
}
}
}