我有以下小孩形式:
要将控件链接到我的数据库表,到目前为止,我已经获得了以下内容。
我试图以类似的方式将 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));
}