C
C#9mo ago
nunumars

✅ cant connect the data

i cant connect the data to this form helpp
No description
No description
21 Replies
Lalan
Lalan9mo ago
what's your code?
nunumars
nunumarsOP9mo ago
here private void btnsave_Click(object sender, EventArgs e) { try { if (MessageBox.Show("Are You Sure You Want To Save This User?", "saving record", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.OK) {
cm = new SqlCommand("INSERT INTO Tableuser(Username,Fullname,Password,PhoneNo.)VALUES(@Username,@Fullname,@Password,@PhoneNo.)", con); cm.Parameters.AddWithValue("@Username", txtuser.Text); cm.Parameters.AddWithValue("@Fullname", txtfullname.Text); cm.Parameters.AddWithValue("@Password", txtpass.Text); cm.Parameters.AddWithValue("@Phone No.", txtphone.Text); con.Open(); cm.ExecuteNonQuery(); con.Close(); MessageBox.Show("User has been successfully saved."); Clear(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } } ..................................... this one's my connector
nunumars
nunumarsOP9mo ago
No description
SG97
SG979mo ago
assuming that tablename is correct, what's the error?
nunumars
nunumarsOP9mo ago
the table name is correct
No description
nunumars
nunumarsOP9mo ago
and i dont know the error T_T
SG97
SG979mo ago
so there is no exception?
nunumars
nunumarsOP9mo ago
it doesnt have any popup after i enter it its just nothing
SG97
SG979mo ago
does it get run? put a breakpoint on the btnsave_Click
nunumars
nunumarsOP9mo ago
whats breakpoint?
SG97
SG979mo ago
$debug
MODiX
MODiX9mo ago
Tutorial: Debug C# code and inspect data - Visual Studio (Windows)
Learn features of the Visual Studio debugger and how to start the debugger, step through code, and inspect data in a C# application.
SG97
SG979mo ago
debugging is the best tool you'll ever have
nunumars
nunumarsOP9mo ago
ohh alrr thankss
SG97
SG979mo ago
F9 is the shortcut for breakpoint
nunumars
nunumarsOP9mo ago
still cant find it T-T
SG97
SG979mo ago
place breakpoint, start debugging (F5), does the breakpoint get hit when you press the save button?
nunumars
nunumarsOP9mo ago
i found it i read this i got lazy earlier but now i read it T-T DAAAANG THANKKK UUUU
SG97
SG979mo ago
perfect
sibber
sibber9mo ago
$close
MODiX
MODiX9mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server