How do you join two data table in one Datagrid c#


How do you join two data table in one Datagrid c#

Write code on button click event

string query = "select * from tbl_company,Narcotic";// tbl or narcotic is table name
            SqlCommand cmd = new SqlCommand(query, con);
            con.Open();
            cmd.ExecuteNonQuery();
            DataTable dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            dataGridView1.DataSource = dt;
            con.Close();

http://coder360s.com/

Code Conclusion is offering excellent opportunities to learn coding, JavaScript, PHP, other computer languages, programming, and Software. We have designed unique, time-oriented, and powerful blog posts and videos so that the users and especially beginners can gain good command over these valuable skills About.

Data grid

Have any Question or Comment?

One comment on “How do you join two data table in one Datagrid c#

[…] to download and install crystal report How do you join two data table in one Datagrid c# How do you join two data table in one Datagrid […]

Leave a Reply

Your email address will not be published. Required fields are marked *

Categories

%d bloggers like this: