Friday, 16 August 2013

Is it possible to add the tablename to a select statement from a textbox value

Is it possible to add the tablename to a select statement from a textbox
value

I am using Visual Studio 2008 and SQL Server 2008. I am trying to give the
tablename from a textbox value as follows:
SqlCommand comm = new SqlCommand("select * from '"+Textbox1.Text+"'", conn);
But I am not getting any results.
Please help me. What have I done wrong here?

No comments:

Post a Comment