Connect to Oracle Database in C#












0















I want to test Oracle Database in my C# windows application. I have created a workspace on Oracle Application Express. I have also created DNS and the connection is formed successfully.



On successful connection I have written a code to get the list of tables.



schemaTable = connection.GetSchema("Tables");


This code snippet successfully returns the list the tables. Now when I try to read the data from EMP table I receive below error:




ERROR [42S02] [Oracle][ODBC][Ora]ORA-00903: invalid table name




Schema and Table



Query to retrieve the data from EMP table



queryString: "Select * from [EMP];"



 using (OdbcConnection connection = new OdbcConnection(connString))
{
try
{
connection.Open();
OdbcDataAdapter da = new OdbcDataAdapter(queryString, connection);
da.Fill(fillGridDt);









share|improve this question




















  • 1





    Please post a Minimal, Complete, and Verifiable example

    – OldProgrammer
    Nov 24 '18 at 17:49











  • Apex workspace has nothing to do with that; it is the database user (schema) that matters. OK, you return list of tables, but can't select anything from EMP table - could you post a command you used?

    – Littlefoot
    Nov 24 '18 at 19:50











  • I have updated my question with code that i have used to get table data

    – user2240189
    Nov 25 '18 at 5:45













  • In my application I am giving 2 options to the user Option 1: Select table name from list of tables Option 2: Type the query In case of Option 1; i.e. table selection; I selected EMP table. In that case i receive invalid table name error. But when I select Option 2: Select * from EMP Query gets executed successfully.

    – user2240189
    Nov 25 '18 at 6:09


















0















I want to test Oracle Database in my C# windows application. I have created a workspace on Oracle Application Express. I have also created DNS and the connection is formed successfully.



On successful connection I have written a code to get the list of tables.



schemaTable = connection.GetSchema("Tables");


This code snippet successfully returns the list the tables. Now when I try to read the data from EMP table I receive below error:




ERROR [42S02] [Oracle][ODBC][Ora]ORA-00903: invalid table name




Schema and Table



Query to retrieve the data from EMP table



queryString: "Select * from [EMP];"



 using (OdbcConnection connection = new OdbcConnection(connString))
{
try
{
connection.Open();
OdbcDataAdapter da = new OdbcDataAdapter(queryString, connection);
da.Fill(fillGridDt);









share|improve this question




















  • 1





    Please post a Minimal, Complete, and Verifiable example

    – OldProgrammer
    Nov 24 '18 at 17:49











  • Apex workspace has nothing to do with that; it is the database user (schema) that matters. OK, you return list of tables, but can't select anything from EMP table - could you post a command you used?

    – Littlefoot
    Nov 24 '18 at 19:50











  • I have updated my question with code that i have used to get table data

    – user2240189
    Nov 25 '18 at 5:45













  • In my application I am giving 2 options to the user Option 1: Select table name from list of tables Option 2: Type the query In case of Option 1; i.e. table selection; I selected EMP table. In that case i receive invalid table name error. But when I select Option 2: Select * from EMP Query gets executed successfully.

    – user2240189
    Nov 25 '18 at 6:09
















0












0








0








I want to test Oracle Database in my C# windows application. I have created a workspace on Oracle Application Express. I have also created DNS and the connection is formed successfully.



On successful connection I have written a code to get the list of tables.



schemaTable = connection.GetSchema("Tables");


This code snippet successfully returns the list the tables. Now when I try to read the data from EMP table I receive below error:




ERROR [42S02] [Oracle][ODBC][Ora]ORA-00903: invalid table name




Schema and Table



Query to retrieve the data from EMP table



queryString: "Select * from [EMP];"



 using (OdbcConnection connection = new OdbcConnection(connString))
{
try
{
connection.Open();
OdbcDataAdapter da = new OdbcDataAdapter(queryString, connection);
da.Fill(fillGridDt);









share|improve this question
















I want to test Oracle Database in my C# windows application. I have created a workspace on Oracle Application Express. I have also created DNS and the connection is formed successfully.



On successful connection I have written a code to get the list of tables.



schemaTable = connection.GetSchema("Tables");


This code snippet successfully returns the list the tables. Now when I try to read the data from EMP table I receive below error:




ERROR [42S02] [Oracle][ODBC][Ora]ORA-00903: invalid table name




Schema and Table



Query to retrieve the data from EMP table



queryString: "Select * from [EMP];"



 using (OdbcConnection connection = new OdbcConnection(connString))
{
try
{
connection.Open();
OdbcDataAdapter da = new OdbcDataAdapter(queryString, connection);
da.Fill(fillGridDt);






c# oracle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 25 '18 at 13:48









thatjeffsmith

7,96211444




7,96211444










asked Nov 24 '18 at 17:43









user2240189user2240189

613415




613415








  • 1





    Please post a Minimal, Complete, and Verifiable example

    – OldProgrammer
    Nov 24 '18 at 17:49











  • Apex workspace has nothing to do with that; it is the database user (schema) that matters. OK, you return list of tables, but can't select anything from EMP table - could you post a command you used?

    – Littlefoot
    Nov 24 '18 at 19:50











  • I have updated my question with code that i have used to get table data

    – user2240189
    Nov 25 '18 at 5:45













  • In my application I am giving 2 options to the user Option 1: Select table name from list of tables Option 2: Type the query In case of Option 1; i.e. table selection; I selected EMP table. In that case i receive invalid table name error. But when I select Option 2: Select * from EMP Query gets executed successfully.

    – user2240189
    Nov 25 '18 at 6:09
















  • 1





    Please post a Minimal, Complete, and Verifiable example

    – OldProgrammer
    Nov 24 '18 at 17:49











  • Apex workspace has nothing to do with that; it is the database user (schema) that matters. OK, you return list of tables, but can't select anything from EMP table - could you post a command you used?

    – Littlefoot
    Nov 24 '18 at 19:50











  • I have updated my question with code that i have used to get table data

    – user2240189
    Nov 25 '18 at 5:45













  • In my application I am giving 2 options to the user Option 1: Select table name from list of tables Option 2: Type the query In case of Option 1; i.e. table selection; I selected EMP table. In that case i receive invalid table name error. But when I select Option 2: Select * from EMP Query gets executed successfully.

    – user2240189
    Nov 25 '18 at 6:09










1




1





Please post a Minimal, Complete, and Verifiable example

– OldProgrammer
Nov 24 '18 at 17:49





Please post a Minimal, Complete, and Verifiable example

– OldProgrammer
Nov 24 '18 at 17:49













Apex workspace has nothing to do with that; it is the database user (schema) that matters. OK, you return list of tables, but can't select anything from EMP table - could you post a command you used?

– Littlefoot
Nov 24 '18 at 19:50





Apex workspace has nothing to do with that; it is the database user (schema) that matters. OK, you return list of tables, but can't select anything from EMP table - could you post a command you used?

– Littlefoot
Nov 24 '18 at 19:50













I have updated my question with code that i have used to get table data

– user2240189
Nov 25 '18 at 5:45







I have updated my question with code that i have used to get table data

– user2240189
Nov 25 '18 at 5:45















In my application I am giving 2 options to the user Option 1: Select table name from list of tables Option 2: Type the query In case of Option 1; i.e. table selection; I selected EMP table. In that case i receive invalid table name error. But when I select Option 2: Select * from EMP Query gets executed successfully.

– user2240189
Nov 25 '18 at 6:09







In my application I am giving 2 options to the user Option 1: Select table name from list of tables Option 2: Type the query In case of Option 1; i.e. table selection; I selected EMP table. In that case i receive invalid table name error. But when I select Option 2: Select * from EMP Query gets executed successfully.

– user2240189
Nov 25 '18 at 6:09














1 Answer
1






active

oldest

votes


















0














I figured out the solution.
It was throwing the error invalid table name as i was using brackets with table name.
i.e. Select * from [EMP]
I tried the query with Select * from EMP; and now it works






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53460816%2fconnect-to-oracle-database-in-c-sharp%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I figured out the solution.
    It was throwing the error invalid table name as i was using brackets with table name.
    i.e. Select * from [EMP]
    I tried the query with Select * from EMP; and now it works






    share|improve this answer




























      0














      I figured out the solution.
      It was throwing the error invalid table name as i was using brackets with table name.
      i.e. Select * from [EMP]
      I tried the query with Select * from EMP; and now it works






      share|improve this answer


























        0












        0








        0







        I figured out the solution.
        It was throwing the error invalid table name as i was using brackets with table name.
        i.e. Select * from [EMP]
        I tried the query with Select * from EMP; and now it works






        share|improve this answer













        I figured out the solution.
        It was throwing the error invalid table name as i was using brackets with table name.
        i.e. Select * from [EMP]
        I tried the query with Select * from EMP; and now it works







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 25 '18 at 6:33









        user2240189user2240189

        613415




        613415
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53460816%2fconnect-to-oracle-database-in-c-sharp%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Costa Masnaga

            Fotorealismo

            Sidney Franklin