Hallo,

i not unterstand the expression {oColPk}, see Row 18. What do have the
braces with the instantiation a DataColumnobject?

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1 Private Sub Test()
2 Dim oDsCustomer As DataSet
3 Dim oTblOrders As DataTable
4 Dim oColPk As DataColumn
5
6 'Eine Tabelle mit 3 Spalten im Arbeitsspeicher anlegen
7 oDsCustomer = New DataSet("CustomerOrders")
8
9 oTblOrders = New DataTable
10 oTblOrders = oDsCustomer.Tables.Add("Orders")
11
12 oColPk = New DataColumn
13
14 oColPk = oTblOrders.Columns.Add("OrderID",
Type.GetType("System.Int32"))
15 oTblOrders.Columns.Add("OrderQuantity", Type.GetType("System.Int32"))
16 oTblOrders.Columns.Add("CompanyName", Type.GetType("System.String"))
17
18 oTblOrders.PrimaryKey = New DataColumn() {oColPk} '<--- What is that?
19 end Sub
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Greetings

Wolfram Hubert

Re: expression for a instantiation a DataColumnobject by William

William
Mon May 31 17:29:45 CDT 2004

The PrimaryKey takes an Array of DataColumn objects. It may be just one
column or it may be more, in this case it just looks like one.

http://www.knowdotnet.com/articles/adopartiii.html

HTH,

Bill

--
W.G. Ryan MVP Windows - Embedded

http://forums.devbuzz.com
http://www.knowdotnet.com/dataaccess.html
http://www.msmvps.com/williamryan/
"Wolfram Hubert" <wolfram.hubert@web.de> wrote in message
news:40bb97d7$0$91894$afc38c87@auth.de.news.easynet.net...
> Hallo,
>
> i not unterstand the expression {oColPk}, see Row 18. What do have the
> braces with the instantiation a DataColumnobject?
>
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
> 1 Private Sub Test()
> 2 Dim oDsCustomer As DataSet
> 3 Dim oTblOrders As DataTable
> 4 Dim oColPk As DataColumn
> 5
> 6 'Eine Tabelle mit 3 Spalten im Arbeitsspeicher anlegen
> 7 oDsCustomer = New DataSet("CustomerOrders")
> 8
> 9 oTblOrders = New DataTable
> 10 oTblOrders = oDsCustomer.Tables.Add("Orders")
> 11
> 12 oColPk = New DataColumn
> 13
> 14 oColPk = oTblOrders.Columns.Add("OrderID",
> Type.GetType("System.Int32"))
> 15 oTblOrders.Columns.Add("OrderQuantity", Type.GetType("System.Int32"))
> 16 oTblOrders.Columns.Add("CompanyName", Type.GetType("System.String"))
> 17
> 18 oTblOrders.PrimaryKey = New DataColumn() {oColPk} '<--- What is that?
> 19 end Sub
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
>
> Greetings
>
> Wolfram Hubert