In order to get textbox value you have to code like this:-
"select * from table where id in ( "+textbox1.text+")";
But this will lead you to Sql Injection problem. So a better approach will be:-
var command = new SqlCommand("SELECT * FROM table WHERE id = @value")
{
Connection = connection();
};
command.Parameters.AddWithValue("value", textbox1.text);
var dataReader = command.ExecuteReader();