datagrid access from another form

后端 未结 3 1530
梦如初夏
梦如初夏 2021-01-27 12:37

I have datagridview in form1. How can I access datagridview from form2.

  private void button1_Click(object sender, EventArgs e)
  {
          string sql1 = \"in         


        
3条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-27 13:31

    You need to make the dataGridView field/property "public" or "internal". Choose public if you're a beginner like it sounds.

提交回复
热议问题