私は次の小さな子フォームを持っています:
コントロールをデータベーステーブルにリンクするために、これまでに次のものを入手しました。
テキストボックスをナビゲーターにリンクするのと同じ方法で、datagridviewをナビゲーターにリンクしようとしました-これらのコントロールを結合するための正しい構文は何ですか?
public SqlCeConnection conn = new SqlCeConnection(ConfigurationManager.ConnectionStrings["WindFormAppRevisionHelper.Properties.Settings.DefinitionsDBConnectionString"].ConnectionString);
BindingSource rawtableBindingSource = new BindingSource();
public uxFormDatabase()
{
InitializeComponent();
fillTheDGVusingAdapter();
}
public void fillTheDGVusingAdapter()
{
SqlCeDataAdapter da = new SqlCeDataAdapter(new SqlCeCommand("Select * From tb_Definitions", conn));
DataSet ds = new DataSet("DGVdata");
ds.Tables.Add("rawTable");
da.Fill(ds.Tables["rawTable"]);
uxDGVtable.DataSource = ds.Tables["rawTable"];
rawtableBindingSource.DataSource = ds.Tables["rawTable"];
uxrawdataBindingNavigator.BindingSource = this.rawtableBindingSource;
//PROBLEM WITH THE FOLLOWING LINE
uxDGVtable.DataSource = DataBindings.Add(new Binding("Text", uxrawdataBindingNavigator, "Item_Id", true));
}