C
C#10mo ago
nunumars

✅ cant connect the data

i cant connect the data to this form helpp
No description
No description
21 Replies
Lalan
Lalan10mo ago
what's your code?
nunumars
nunumarsOP10mo 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
nunumarsOP10mo ago
No description
SG97
SG9710mo ago
assuming that tablename is correct, what's the error?
nunumars
nunumarsOP10mo ago
the table name is correct
No description
nunumars
nunumarsOP10mo ago
and i dont know the error T_T
SG97
SG9710mo ago
so there is no exception?
nunumars
nunumarsOP10mo ago
it doesnt have any popup after i enter it its just nothing
SG97
SG9710mo ago
does it get run? put a breakpoint on the btnsave_Click
nunumars
nunumarsOP10mo ago
whats breakpoint?
SG97
SG9710mo ago
$debug
MODiX
MODiX10mo 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
SG9710mo ago
debugging is the best tool you'll ever have
nunumars
nunumarsOP10mo ago
ohh alrr thankss
SG97
SG9710mo ago
F9 is the shortcut for breakpoint
nunumars
nunumarsOP10mo ago
still cant find it T-T
SG97
SG9710mo ago
place breakpoint, start debugging (F5), does the breakpoint get hit when you press the save button?
nunumars
nunumarsOP10mo ago
i found it i read this i got lazy earlier but now i read it T-T DAAAANG THANKKK UUUU
SG97
SG9710mo ago
perfect
sibber
sibber10mo ago
$close
MODiX
MODiX10mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server