有关数据源DataSource的一些属性

FM中数据源的属性

  • 名称:导入的content manager数据源的名称。可随意命名

  • Content Manager数据源:导入的content manager数据源(假设是ODBC数据源,应与ODBC数据源一致)

  • 目录(catalog):从database获得

  • 模式(schema):从database获得

下图信息转载自外网
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
数据源绑定是指将数据源中的数据与控件进行关联,使得控件能够显示数据源中的数据。在 .NET Framework 中,常用的数据源包括 DataSet、DataTable、BindingSource 等。数据源绑定的步骤如下: 1. 创建数据源:可以使用 Visual Studio 中的数据工具,或者手动编写代码创建数据源。 2. 创建数据适配器:数据适配器是用来连接数据源和控件之间的桥梁,可以通过代码或者数据工具创建。 3. 填充数据:调用数据适配器的 Fill 方法,将数据源中的数据填充到 DataSet 或 DataTable 中。 4. 绑定控件:使用控件的 DataSource 属性数据源与控件进行关联,使用控件的 DataMember 属性指定要显示的数据表或数据视图。 下面是一个简单的例子,演示如何使用 BindingSource 绑定一个 DataGridView 控件: ```csharp // 创建 DataSet 和 BindingSource DataSet ds = new DataSet(); BindingSource bs = new BindingSource(); // 创建数据适配器并填充数据 string connectionString = "Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=True"; SqlConnection connection = new SqlConnection(connectionString); string sql = "SELECT * FROM Customers"; SqlDataAdapter adapter = new SqlDataAdapter(sql, connection); adapter.Fill(ds, "Customers"); // 将 BindingSource 和 DataGridView 绑定 bs.DataSource = ds.Tables["Customers"]; dataGridView1.DataSource = bs; ``` 在这个例子中,我们首先创建了一个 DataSet 和一个 BindingSource 对象,然后使用 SqlDataAdapter 填充了 DataSet 中的 Customers 表。最后,将 BindingSource 和 DataGridView 控件进行了绑定,让控件显示了 Customers 表中的数据。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值