Click here to Skip to main content
16,005,162 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: Resetting a ListBox Pin
Luc Pattyn6-Dec-09 7:04
sitebuilderLuc Pattyn6-Dec-09 7:04 
QuestionAppending text Pin
Pasan1486-Dec-09 6:25
Pasan1486-Dec-09 6:25 
AnswerRe: Appending text Pin
dan!sh 6-Dec-09 6:36
professional dan!sh 6-Dec-09 6:36 
GeneralRe: Appending text Pin
Pasan1486-Dec-09 7:00
Pasan1486-Dec-09 7:00 
GeneralRe: Appending text Pin
Luc Pattyn6-Dec-09 7:06
sitebuilderLuc Pattyn6-Dec-09 7:06 
GeneralRe: Appending text Pin
Pasan1486-Dec-09 7:23
Pasan1486-Dec-09 7:23 
GeneralRe: Appending text Pin
Luc Pattyn6-Dec-09 7:55
sitebuilderLuc Pattyn6-Dec-09 7:55 
QuestionDo I have to manually create a recordNumber as primary key in dataset? Pin
JUNEYT6-Dec-09 3:29
JUNEYT6-Dec-09 3:29 
Hello,

I am facing with a strange problem when I read values from a dataset table. When I make a new row entry in to datatable ("Expenses"), I assumed that it would generate the RecordNumber (Primary Key) as it has already been defined in the original database table. The record number uses auto increment (seed= 100, and AutoIncrement value = 5). However, when a make a new row entry into dataset table, it doesn't produce a new record number but -1. Do I have to manually create a RecordNumber to use in dataset table?

When I tried to read from datatable and put the value into Listview, I realized that it puts explanation instead of RecordNumber into RecordNumber column in the Listview. If you know the solution, please let me know.

Regards.

WHERE DO I MAKE A MISTAKE?


Dim NewRow As BPRO.ExpensesRow = BPRO.Expenses.NewRow()

NewRow("CategoryNumber") = CInt(Category.SelectedValue)
NewRow("Currency") = Currency.SelectedItem
NewRow("PaidAs") = Paidas.SelectedItem
NewRow("DateRecorded") = DatePaid.Value.ToShortDateString
NewRow("Explanation") = Trim(Explanation.Text)
NewRow("Amount") = CDec(Amount.Text)
NewRow("CreditCardNumber") = CInt(Whichcreditcard.SelectedValue)

BPRO.Expenses.Rows.Add(NewRow)


ExpensesTableAdapter1.Insert(CInt(Category.SelectedValue), _
                             Currency.SelectedItem, _
                             Paidas.SelectedItem, _
                             DatePaid.Value.ToShortDateString, _
                             Trim(Explanation.Text), _
                             CDec(Amount.Text), _
                             CInt(Whichcreditcard.SelectedValue))


LI.Text = xrow("RecordNumber")
ListView1.Items.Add(LI)


What a curious mind needs to discover knowledge is noting else than a pin-hole.


AnswerRe: Do I have to manually create a recordNumber as primary key in dataset? Pin
Dave Kreskowiak6-Dec-09 15:44
mveDave Kreskowiak6-Dec-09 15:44 
Questionlistbox inconsistency Pin
Tim Kredlo5-Dec-09 22:23
Tim Kredlo5-Dec-09 22:23 
AnswerRe: listbox inconsistency Pin
Luc Pattyn6-Dec-09 1:23
sitebuilderLuc Pattyn6-Dec-09 1:23 
GeneralRe: listbox inconsistency Pin
Tim Kredlo6-Dec-09 7:41
Tim Kredlo6-Dec-09 7:41 
GeneralRe: listbox inconsistency Pin
Luc Pattyn6-Dec-09 7:59
sitebuilderLuc Pattyn6-Dec-09 7:59 
GeneralRe: listbox inconsistency Pin
Tim Kredlo6-Dec-09 8:41
Tim Kredlo6-Dec-09 8:41 
GeneralRe: listbox inconsistency Pin
Luc Pattyn6-Dec-09 8:46
sitebuilderLuc Pattyn6-Dec-09 8:46 
GeneralRe: listbox inconsistency Pin
Tim Kredlo6-Dec-09 9:00
Tim Kredlo6-Dec-09 9:00 
GeneralRe: listbox inconsistency Pin
Luc Pattyn6-Dec-09 9:15
sitebuilderLuc Pattyn6-Dec-09 9:15 
GeneralRe: listbox inconsistency Pin
Tim Kredlo6-Dec-09 10:52
Tim Kredlo6-Dec-09 10:52 
QuestionReplace function in vb6 with MS Access using adodb.recordset Pin
Tufail Ahmad4-Dec-09 18:16
Tufail Ahmad4-Dec-09 18:16 
AnswerRe: Replace function in vb6 with MS Access using adodb.recordset Pin
Luc Pattyn5-Dec-09 2:46
sitebuilderLuc Pattyn5-Dec-09 2:46 
QuestionShould I have to explicity create a dataset even it is already defined in design time? Pin
JUNEYT4-Dec-09 11:43
JUNEYT4-Dec-09 11:43 
AnswerRe: Should I have to explicity create a dataset even it is already defined in design time? Pin
T21024-Dec-09 12:46
T21024-Dec-09 12:46 
QuestionCustom Events Pin
#realJSOP4-Dec-09 0:29
professional#realJSOP4-Dec-09 0:29 
AnswerRe: Custom Events Pin
Geoff Williams4-Dec-09 1:23
Geoff Williams4-Dec-09 1:23 
AnswerRe: Custom Events Pin
Dave Kreskowiak4-Dec-09 3:40
mveDave Kreskowiak4-Dec-09 3:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.