Click here to Skip to main content
15,908,437 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: how to convert date format in vb?? Pin
Rizwan Bashir22-Jul-06 3:34
Rizwan Bashir22-Jul-06 3:34 
Questioncould not correctly add a new record Pin
VBDotnetNewbie21-Jul-06 9:17
VBDotnetNewbie21-Jul-06 9:17 
Hi,

I am stuck with this problem for weeks. To put it simple, for example, I have two related tables in MS SQLServer 2000 express: Author and Publications. The Publications table has a foreign key author_id and its primary key is of type int, which Identity is set to "Yes", Seed is set to "0". After playing with the tables for a while, when I use the addnew() to add a new record in the "Publication" table, the index number of the author_id always give me a wrong number: 2 more than the desired number. For example, I have the last record with author_id = 100 in my database, when I try to add the new record, it always give me the author_id of 103. So after update(), there are two records shown here, one with author_id 101 and the other 103. Of course the 103 is wrong, and if I keep working with this fake record, an error with occur. I have to close the form and reopen it, then only the desired record with author_id 101 shown up. The following is the addnew function I used:

Private Sub btnAdd_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAdd.Click

Me.BindingContext(DsAuthorPub, "Author.AuthorPub").EndCurrentEdit()
Me.BindingContext(DsAuthorPub, "Author.AuthorPub").AddNew()

End Sub

Could anyone please give me some hint why I have this problem and how to deal with it?

Thanks alot,

VBDotNetNewbie

VBDotNetNewbie

Generalsorry, a correction of the question: should be "pub_id" not "Author_id" Pin
VBDotnetNewbie21-Jul-06 9:24
VBDotnetNewbie21-Jul-06 9:24 
QuestionPicture in Database Pin
aransiola21-Jul-06 8:30
aransiola21-Jul-06 8:30 
AnswerRe: Picture in Database Pin
mbuller21-Jul-06 8:53
mbuller21-Jul-06 8:53 
GeneralRe: Picture in Database Pin
aransiola21-Jul-06 9:39
aransiola21-Jul-06 9:39 
AnswerRe: Picture in Database Pin
Dave Sexton22-Jul-06 4:23
Dave Sexton22-Jul-06 4:23 
AnswerRe: Picture in Database Pin
karansharma28-Jul-06 19:26
karansharma28-Jul-06 19:26 
QuestionConfiguring adapters @ time of installation. Pin
work4me21-Jul-06 7:19
work4me21-Jul-06 7:19 
AnswerRe: Configuring adapters @ time of installation. Pin
mbuller21-Jul-06 8:50
mbuller21-Jul-06 8:50 
GeneralRe: Configuring adapters @ time of installation. Pin
mbuller21-Jul-06 8:56
mbuller21-Jul-06 8:56 
Questionwhat is the best practice for .......... Pin
Najmunnisha21-Jul-06 4:44
Najmunnisha21-Jul-06 4:44 
AnswerRe: what is the best practice for .......... Pin
Rizwan Bashir21-Jul-06 5:17
Rizwan Bashir21-Jul-06 5:17 
QuestionConverted from VS2003 to VS2005 and getting cannot convert system.Decimal to SqlTypes.Double error Pin
leckey21-Jul-06 4:12
leckey21-Jul-06 4:12 
AnswerRe: Converted from VS2003 to VS2005 and getting cannot convert system.Decimal to SqlTypes.Double error Pin
Dave Sexton21-Jul-06 21:06
Dave Sexton21-Jul-06 21:06 
QuestionAdding Read Only Property to a axmskedit box Pin
mbuller21-Jul-06 3:27
mbuller21-Jul-06 3:27 
QuestionHow would a DB communicate with the application? Pin
Rajiya21-Jul-06 1:48
Rajiya21-Jul-06 1:48 
AnswerRe: How would a DB communicate with the application? Pin
Vasudevan Deepak Kumar21-Jul-06 1:49
Vasudevan Deepak Kumar21-Jul-06 1:49 
GeneralRe: How would a DB communicate with the application? Pin
Rajiya23-Jul-06 21:30
Rajiya23-Jul-06 21:30 
AnswerRe: How would a DB communicate with the application? Pin
Dave Kreskowiak21-Jul-06 2:15
mveDave Kreskowiak21-Jul-06 2:15 
QuestionClass of Classes! Pin
Alex Feature20-Jul-06 23:56
Alex Feature20-Jul-06 23:56 
AnswerRe: Class of Classes! Pin
Robert Rohde20-Jul-06 23:58
Robert Rohde20-Jul-06 23:58 
GeneralRe: Class of Classes! Pin
Alex Feature21-Jul-06 0:47
Alex Feature21-Jul-06 0:47 
GeneralRe: Class of Classes! Pin
Robert Rohde21-Jul-06 2:21
Robert Rohde21-Jul-06 2:21 
GeneralRe: Class of Classes! Pin
Alex Feature21-Jul-06 3:02
Alex Feature21-Jul-06 3:02 

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.