aydinozdemir
Member
- Joined
- May 15, 2011
- Messages
- 15
- Programming Experience
- Beginner
hello again..firstly thank you for your previous helps on my way learning access and oledb. i recently have a problem with reading a programmatically created database table.
i use the code below to create the table..command works with no problem..
[XCODE]cmd = New OleDbCommand("CREATE TABLE 2011 (Month numeric (2) PRIMARY KEY, Day1 text,Day2 text, Day3 text, Day4 text, Day5 text, Day6 text, Day7 text)", con)[/XCODE]
after creating the table i try to fill the tables content into a combobox..only data i get into the combobox is something like null items..i tried to filter null and recurring records but no success.i still get empty combobox..
on other side, with the same code, i can fill the combobox with table contents if the table was created manually from inside ms-access..
i tried different types but no success (varchar, integer)..what can the problem be and how to solve it..thanks for any help.[/COLOR]
i use the code below to create the table..command works with no problem..
[XCODE]cmd = New OleDbCommand("CREATE TABLE 2011 (Month numeric (2) PRIMARY KEY, Day1 text,Day2 text, Day3 text, Day4 text, Day5 text, Day6 text, Day7 text)", con)[/XCODE]
after creating the table i try to fill the tables content into a combobox..only data i get into the combobox is something like null items..i tried to filter null and recurring records but no success.i still get empty combobox..
Dim ItemList As New ArrayList() Dim row As DataRow 'Represents a row of data in Systems.data.datatable For Each row In dsogretmen.Tables(0).Rows If row(1).ToString.Length > 0 Then For i = 1 To 8 If Not IsDBNull(row(i).ToString) Then If Not ItemList.Contains(row(i)) Then ItemList.Add(row(i).ToString) End If End If Next End If Next ComboBox2.Items.Clear() For i = 0 To ItemList.Count - 1 ComboBox2.Items.Add(ItemList.Item(i)) ComboBox2.Sorted = True Next
on other side, with the same code, i can fill the combobox with table contents if the table was created manually from inside ms-access..
i tried different types but no success (varchar, integer)..what can the problem be and how to solve it..thanks for any help.[/COLOR]