Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Darkc0der Darkc0der is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 598
Rep Power: 14
Darkc0der mempunyai hidup yang Normal
Default Help C# + ms.access

jadi gini gan,gw kan lg bkin program data urut kepegawaian..



errornya disini nihhh




Code:

private void btndelete_Click(object sender, EventArgs e)
{
//id = lblID.Text;
nip = textBox1.Text;
sqlQRY = "Delete * from pegawai where nip = " + nip + "";
cmd.CommandText = sqlQRY;
cmd.Connection = cn;
cmd.ExecuteNonQuery();

MessageBox.Show("Delete!", "Programmed By Cedrick", MessageBoxButtons.OK, MessageBoxIcon.Information);
clear();
fill();
}

sama yang ini




Code:

void UpdateQRY()
{
if (textBox1.Text == "")
{ }
else if (textBox2.Text == "")
{ }
else
{
//id = lblID.Text;
nip = textBox1.Text;
sqlQRY = "Update pegawai SET pegawai.nip = '" + textBox1.Text + "', pegawai.nama = '" + textBox2.Text + "', pegawai.pangkatgol = '" + textBox3.Text + "', pegawai.pangkattmt = '" + textBox4.Text + "', pegawai.jabatan = '" + textBox5.Text + "', pegawai.tmt = '" + textBox6.Text + "', pegawai.masatahun = '" + textBox7.Text + "', pegawai.masabulan = '" + textBox8.Text + "', pegawai.latjabatan = '" + textBox9.Text + "', pegawai.blnthn = '" + textBox10.Text + "', pegawai.jumlah = '" + textBox11.Text + "', pegawai.pendidikan = '" + textBox12.Text + "', pegawai.lulustahun = '" + textBox13.Text + "', pegawai.tingkatijazah = '" + textBox14.Text + "', pegawai.cat = '" + textBox15.Text + "', pegawai.ket = '" + textBox16.Text + "' WHERE pegawai.nip = " + nip + "";
cmd.CommandText = sqlQRY;
cmd.Connection = cn;
cmd.ExecuteNonQuery();

MessageBox.Show("Updated!", "Programmed By Cedrick", MessageBoxButtons.OK, MessageBoxIcon.Information);
clear();
fill();
}
}

jadi pas mo delete records ama mo update records..



nih file db nya http://www.media*fire..com/?aacoi62pl481pd6



erronya oledbexception was unhandled

data type mismatch in criteria expression..



help dah puyeng nih gan T_T



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 11:20 PM.


no new posts