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