instead of passing the name in the request, you can easily replace it here
string s = "select * from " + name; SqlCommand cmd = new SqlCommand(s, con); SqlDataReader rd = cmd.ExecuteReader();
but this will cause sql input error
therefore, I would suggest that you execute a dyanmic query on the sql server, which you can do with SP_ExecuteSQL .
source share