Click here to Skip to main content
15,906,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
in web.config
XML
<appSettings>
        <add key="ConnectionString" value="Data Source=SAYAN-PC;Initial Catalog=MyPhotos;User ID=sa;Password=lock"/>
        <add key="MyPhotos" value="TEST_TABLE1"/>
        <add key="TitleField" value="1"/>
        <add key="RatedByField" value="2"/>
        <add key="ScoreField" value="3"/>
    </appSettings>

and in .cs
SQL
string p = "Select * from " + ConfigurationSettings.AppSettings["MyPhotos"] + " WHERE id = '" + Convert.ToInt32(Request.QueryString["id"]) + "'";

after debugging i get the following error
Quote:
Error: Invalid object name TEST_TABLE1
Posted

It means table "TEST_TABLE1" does not exists. make sure you have this table in "MyPhotos" table.
 
Share this answer
 
Comments
sahabiswarup 23-Jan-12 5:49am    
TEST_TABLE1 is exists in MyPhotos
Hi,

can you show more code? probably you try to execute this query against other db than MyPhotos. This error message indicates, that TEST_TABLE is not created in db.

Regards
Robert
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900