2.通过DB PAINTER来 *** 作,首先PB要通过DB PAINTER连接上数据库,然后选择这个连接,找到表,右键选择edit,打开,找到数据,在rows菜单下找到insert,点击增加一行,填写值,然后rows菜单下的save changes即可以保存。
3.建立数据窗口,可以在preview界面添加数据, *** 作方法同上。只是数据在数据窗口的预览界面添加。
这个满足你的要求可以将数据窗口指定的起始行、结束行---起始列、结束列整个块得数据放到一个数组中
如果指定列2即起始列和结束列均为2 你可以设置行为0到dw.RowCount
如果英文看来有不便之处 可以细问
Description
You can access data in a range of rows and columns by specifying the starting and ending row and column numbers.
Syntax
dwcontrol.Object.Data {.buffer } {.datasource } [ startrownum, startcolnum, endrownum, endcolnum ]
Parameter Description
dwcontrol The name of the DataWindow control or child DataWindow in which you want to get or set data
buffer (optional) The name of the buffer from which you want to get or set data. Values are:?Primary ?(Default) The data in the primary buffer (the data that has not been deleted or filtered out)?Delete ?The data in the delete buffer (data deleted from the DataWindow control)?Filter ?The data in the filter buffer (data that was filtered out)
datasource (optional) The source of the data. Values are:?Current ?(Default) The current values in the DataWindow control?Original ?The values that were initially retrieved from the database
startrownum The number of the first row in the desired range of rows
startcolnum The number for the first column in the range
endrownum The number of the last row in the desired range of rows
endcolnum The number for the last column in the rangeThe row and column numbers must be enclosed in brackets and separated by commas
Return value
An array of structures or user objects. There is one structure element or user object instance variable for each column in the designated range. The data type of each element matches the data type of the corresponding column. There is one structure or user object in the array for each row in the range of rows.
Usage
When you specify a block, the expression always returns an array and you must assign the result to an array, even if you know there is only one structure in the result.
This expression returns an array of one structure from row 22:
dw_1.Object.data[22,1,22,4]
This expression returns an array of one value from row 22, column 1:
dw_1.Object.data[22,1,22,1]
数组是不允许再往里面添加值的,你可以将数组放到List<int>里面如
int[] a ={ x, x, x }
List<int>list = new List<int>()
foreach (int i in a)
{
list.Add(i)
}
list.Add(y)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)