locked
How to read InnerJoin statement result in C#? RRS feed

  • Question

  • I want to get results in runtime. How i can do it? I can't call it.

     

    I write that:

     

     

        using (SqlCommand cmd = new SqlCommand(str, this.conn))
                    {
                        SqlDataReader dr = cmd.ExecuteReader();
    
                        while (dr.Read())
                        {
                            MessageBox.Show(dr["Name"].ToString());
                        }
    
                        dr.Close();
                    }
    

    But it gave me same result with the str="Select * from Table". It gave me Name column of all rows.

     

    Thanks.

     

     


    Assassin's Creed: Nothing is True, Everything is Permitted.
    Wednesday, August 24, 2011 11:29 AM

Answers

  • no, not very big thing. Just i have written sql statement wrong. I am new in SQL. So, sometimes i can made very reduntant mistakes.

    Assassin's Creed: Nothing is True, Everything is Permitted.
    • Marked as answer by Jackie-Sun Monday, August 29, 2011 6:37 AM
    Saturday, August 27, 2011 7:05 AM

All replies

  • Not sure what your question is. Do you want to display other columns?
    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, August 24, 2011 11:52 AM
  • i was very tired. So, i made a little mistake.

    Now i found it and fixed.

     

    Thanks anyway.


    Assassin's Creed: Nothing is True, Everything is Permitted.
    Wednesday, August 24, 2011 12:18 PM
  • Happy to see that you fixed the issue, how did you fix it? Could you please share your solution to us?

    Have a nice day,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Saturday, August 27, 2011 6:00 AM
  • no, not very big thing. Just i have written sql statement wrong. I am new in SQL. So, sometimes i can made very reduntant mistakes.

    Assassin's Creed: Nothing is True, Everything is Permitted.
    • Marked as answer by Jackie-Sun Monday, August 29, 2011 6:37 AM
    Saturday, August 27, 2011 7:05 AM
  • Ah...please keep marching on. If you have any questions, please feel free to create a thread in the community, we will try our best to help you.

     

    Have a nice day,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, August 29, 2011 6:39 AM
  • Thanks.
    Assassin's Creed: Nothing is True, Everything is Permitted.
    Monday, August 29, 2011 6:46 AM