Table Not Created
From: Ken Kazinski (KenKazinski_at_discussions.microsoft.com)
Date: 01/29/05
- Previous message: Gregory: "Validating the input of datagrid"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 29 Jan 2005 07:13:02 -0800
Hi,
I am using the code below and the table does not get created in the access
database. Also I get a error when I close the record set.
Ken
cnnDB.ConnectionString = strProvider & "Data Source=" & strDataSource
cnnDB.Open()
Dim myDataTable As Data.DataTable = New Data.DataTable(cTableName)
' Declare DataColumn and DataRow variables.
Dim myDataColumn As Data.DataColumn
' Create new DataColumn, set DataType, ColumnName and add to DataTable.
myDataColumn = New Data.DataColumn
myDataColumn.DataType = System.Type.GetType("System.Int32")
myDataColumn.ColumnName = "Impulse"
myDataTable.Columns.Add(myDataColumn)
myDataTable.AcceptChanges() ' DS.Tables(cTableName).AcceptChanges()
For LCV = 32 To 1 Step -1
myDataColumn = New Data.DataColumn
With myDataColumn
.Caption = "Speed " & LCV
.ColumnName = "Speed_" & LCV
.DataType = System.Type.GetType("System.Int32")
End With
myDataTable.Columns.Add(myDataColumn)
Next
myDataTable.AcceptChanges()
Dim custDA As OleDbDataAdapter = New OleDbDataAdapter()
Dim adoRS As ADODB.Recordset = New ADODB.Recordset()
custDA.Fill(myDataTable, adoRS)
adoRS.Close()
cnnDB.Close()
- Previous message: Gregory: "Validating the input of datagrid"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|