Click here to Skip to main content
15,897,518 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard MacCutchan16-Mar-16 5:35
mveRichard MacCutchan16-Mar-16 5:35 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Real Corks17-Mar-16 1:24
Real Corks17-Mar-16 1:24 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard Deeming17-Mar-16 2:01
mveRichard Deeming17-Mar-16 2:01 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Richard MacCutchan15-Mar-16 10:35
mveRichard MacCutchan15-Mar-16 10:35 
AnswerRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Eddy Vluggen15-Mar-16 10:10
professionalEddy Vluggen15-Mar-16 10:10 
JokeRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Sascha Lefèvre15-Mar-16 10:44
professionalSascha Lefèvre15-Mar-16 10:44 
GeneralRe: How to separate the hours and min.? because the hours is only added to min.? Pin
Eddy Vluggen15-Mar-16 11:02
professionalEddy Vluggen15-Mar-16 11:02 
RantInsert data in multiple table and having froreign key... Pin
Member 1238897313-Mar-16 20:10
Member 1238897313-Mar-16 20:10 
Hello
I am programming with vb.net and mysql database, and I have a database 'boky' and 3 tables, (table hard : id_hard,name, ip, id_user) , (table os: id-os, libelle), (table user: id_user, name, mailuser).
if I insert data in table hard, there is an error message ("cannot add or update a child row: a foreign key constraint fails ('boky'.'hard', CONSTRAINT 'FK_hard_id_user' FOREING KEY ('id_user') REFERENCES 'user' (id_user))"


this is my source code


Dim query As String = "INSERT INTO hard(name, ip, id_user) VALUES (?,?,?)"
Dim query 2 As String = "SELECT @@Identity"
Dim connstring As String = "server=localhost;UID=Dohery;Database=boky;Password=122346"
Dim Id As Integer
Using conn As New MySqlConnection (connstring)
Using cmd As New MySqlCommand(query,conn)
cmd.Parameters.AddWithValue("",TextBox11.Text)

cmd.Parameters.AddWithValue("",TextBox9.Text)

cmd.Parameters.AddWithValue("",ComboBox6.Text)
conn.Open()
cmd.ExecuteQuery()
cmd.CommandText = query2
ID=cmd.ExecuteScalar()
End Using
End Using


Help me plezzzzzz, thanks.

modified 14-Mar-16 3:16am.

GeneralRe: Insert data in multiple table and having froreign key... Pin
Mycroft Holmes13-Mar-16 21:25
professionalMycroft Holmes13-Mar-16 21:25 
QuestionExperiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy4-Mar-16 3:45
Jon_Boy4-Mar-16 3:45 
AnswerRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen4-Mar-16 12:04
professionalEddy Vluggen4-Mar-16 12:04 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy4-Mar-16 14:39
Jon_Boy4-Mar-16 14:39 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen4-Mar-16 23:37
professionalEddy Vluggen4-Mar-16 23:37 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Jon_Boy9-Mar-16 10:45
Jon_Boy9-Mar-16 10:45 
GeneralRe: Experiencing odd behavior when adding new row to datagridview (databound to bs) Pin
Eddy Vluggen9-Mar-16 10:58
professionalEddy Vluggen9-Mar-16 10:58 
QuestionCan someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Real Corks2-Mar-16 12:13
Real Corks2-Mar-16 12:13 
AnswerRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan2-Mar-16 21:12
mveRichard MacCutchan2-Mar-16 21:12 
AnswerRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard Deeming2-Mar-16 22:34
mveRichard Deeming2-Mar-16 22:34 
GeneralRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan2-Mar-16 22:49
mveRichard MacCutchan2-Mar-16 22:49 
GeneralRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Real Corks3-Mar-16 19:25
Real Corks3-Mar-16 19:25 
GeneralRe: Can someone help me "How to compute late and total hours and save to another column same datagrid view with this code"? Pin
Richard MacCutchan3-Mar-16 21:40
mveRichard MacCutchan3-Mar-16 21:40 
Questioncan someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 6:40
Real Corks2-Mar-16 6:40 
AnswerRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Dave Kreskowiak2-Mar-16 6:51
mveDave Kreskowiak2-Mar-16 6:51 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 7:41
Real Corks2-Mar-16 7:41 
GeneralRe: can someone help me to fix this in mysql vb "INVALID ATTEMP TO READ WHEN READER IS CLOSE "? Pin
Real Corks2-Mar-16 7:49
Real Corks2-Mar-16 7:49 

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.