0

When I import Dataset to application in connnection string I choose "No exclude information from connection string. I will set this information in my aplication".

Now when I compile the form there is nothing to see in the DataGrid, where I must place connection in my application to connet ?

Now I have:

 public Form1()
        {
            InitializeComponent();

            using (OracleConnection con = new OracleConnection("Data Source=localhost;Persist Security Info=True;User ID=martynas;Password=xxxxxxx;Unicode=True"))
            {
                try
                {
                    con.Open();
                    OracleCommand cmd = new OracleCommand();
                    cmd.Connection = con;
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }

This conection is open, but DataGridView still does not show any records. I think that maybe I place connection in wrong method ?

1 Answer 1

1

You are not connecting your OracleCommand to anything. You create it but when it goes out of scope, it ceases to exists.

Sign up to request clarification or add additional context in comments.

2 Comments

Ok, but how to set that my DataGridView using my this connection is possible?
It's not practical to give you a complete tutorial here. You need to look at some code samples and perhaps on-line videos to get a grasp of what to do.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.