Hi all
I have 2 tables created through MS Management Studio
Users and Passwords
Now the current code i have is
But this is throwing an error messageCode:''Insert the new Password newConnection.sendCommand("INSERT INTO passwords VALUES ('" + TextBox2.Text + "')") 'Retrieve the last Insert ID Dim lastID As Integer = newConnection.retrieveID("SELECT password_id from passwords WHERE password_id = @@IDENTITY") 'insert the last ID into the users table, So we know which password is linked to which user by its id. newConnection.sendCommand("INSERT INTO users(username,password_id) VALUES ('" + TextBox1.Text + "'," + lastID + ")")
Conversion from string "INSERT INTO users(username,passw" to type 'Double' is not valid.
When i step through the application LastID does have the last Inserted ID from passwords table, And the table field is set to Integer value, So i cant really see whats going wrong at the moment.
Many Thanks Barrab




Reply With Quote