Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
shan1430
Yak Posting Veteran
86 Posts |
Posted - 2008-07-01 : 00:01:27
|
| Hi,I have 5 tables in my database, WW01,WW02, WW03,WW04,WW05.and i need to call them using sql command from my webform where i have a dropdown list to select these 5 tables. So if i select WW01 from the dropdownlist it should call the WW01 table from my database.Any idea how should i do this?this is how i tried but noy working.. "SELECT * FROM '" + list.SelectedValue + "'" |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-01 : 00:03:14
|
any error ? KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
shan1430
Yak Posting Veteran
86 Posts |
Posted - 2008-07-01 : 00:24:29
|
| no output. |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-01 : 00:39:01
|
| Are you sure you executed this?Probably you could try displaying the sql string before executing to check if its taking the correct value in buiding string. Also have you checked in Query analyser if query returns records? are you also sure if you're having correct schema for table? else you might try putting schema name alsoselect * from schemaname.tablename |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2008-07-01 : 00:40:02
|
you don't need to put the single quote around the table name. Use [ ] if your table name contains spaces etc"SELECT * FROM [" + list.SelectedValue + "]" KH[spoiler]Time is always against us[/spoiler] |
 |
|
|
|
|
|