Click here to Skip to main content
15,314,223 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
                    string query = "SELECT column_name FROM information_schema.columns where table_name = '" + str + "' order by ordinal_position";
                    SqlDataAdapter mydata = new SqlDataAdapter(query, con2);
                    mydata.Fill(ds1, str);

error Invalid object name 'information_schema.columns'. what i do pls help

The database has a case-sensitive collation, try all upper case INFORMATION_SCHEMA.COLUMNS. Or you don't have permission.

Generate the actual query and fetch it at debug time and post it here if that doesn't help.

[Please accept/up-vote answers or solutions that work for you to encourage others]
string query = "SELECT column_name FROM INFORMATION_SCHEMA.COLUMNS where table_name = '" + str + "' order by ordinal_position";

change the INFORMATION_SCHEMA.COLUMNS in capital problem solve thank you

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