mehrshadms
یک شنبه 23 تیر 1392, 11:08 صبح
سلام من کد درج د دیتابیس رو نوشتم به صورت زیر
SqlConnection con1 = new SqlConnection();
con1.ConnectionString = global::WIN1.Properties.Settings.Default.connectio nstrring;
con1.Open();
SqlCommand c1 = new SqlCommand();
c1.Connection = con1;
c1.CommandText = "insert into TBLCASABIT(CARI_KOD , ULKE_KODU , CARI_ISIM , CARI_TEL , EMAIL , POSTAKODU , GRUP_KODU , RAPOR_KODU4 , RAPOR_KODU1 , RAPOR_KODU2 , PLASIYER_KODU , ODEMETIPI , SUBE_KODU , ISLETME_KODU )values(N'214" + txtCustomerCode.Text + "', N'" + txtPass.Text + "', N'" + txtFname.Text + " " + "' , N'" + txtMobNumber.Text + "' , N'" + txtEmail.Text + "', N'" + txtPCode.Text + "', N'" + cmb2.SelectedIndex + "', N'" + txtMasir.Text + "' , N'" + txtbakhsh.Text + "', N'" + txtSenf.Text + "', N'" + txtVisitor.Text + "', N'" + comboPayment.SelectedIndex + "' , N'" + Convert.ToInt32(lblSubeKodu.Text) + "', N'" + Convert.ToInt32(lblheading.Text) + "') ";
c1.ExecuteNonQuery();
con1.Close();
می خوام این کد رو ببرم تو کلاس و در همه جا ازش استفده کنم کسی می تونه راهنماییم کنه ( من تو این مورد چیزی نمی دونم لطفاً امل راهنمای کنید)
ممنون
SqlConnection con1 = new SqlConnection();
con1.ConnectionString = global::WIN1.Properties.Settings.Default.connectio nstrring;
con1.Open();
SqlCommand c1 = new SqlCommand();
c1.Connection = con1;
c1.CommandText = "insert into TBLCASABIT(CARI_KOD , ULKE_KODU , CARI_ISIM , CARI_TEL , EMAIL , POSTAKODU , GRUP_KODU , RAPOR_KODU4 , RAPOR_KODU1 , RAPOR_KODU2 , PLASIYER_KODU , ODEMETIPI , SUBE_KODU , ISLETME_KODU )values(N'214" + txtCustomerCode.Text + "', N'" + txtPass.Text + "', N'" + txtFname.Text + " " + "' , N'" + txtMobNumber.Text + "' , N'" + txtEmail.Text + "', N'" + txtPCode.Text + "', N'" + cmb2.SelectedIndex + "', N'" + txtMasir.Text + "' , N'" + txtbakhsh.Text + "', N'" + txtSenf.Text + "', N'" + txtVisitor.Text + "', N'" + comboPayment.SelectedIndex + "' , N'" + Convert.ToInt32(lblSubeKodu.Text) + "', N'" + Convert.ToInt32(lblheading.Text) + "') ";
c1.ExecuteNonQuery();
con1.Close();
می خوام این کد رو ببرم تو کلاس و در همه جا ازش استفده کنم کسی می تونه راهنماییم کنه ( من تو این مورد چیزی نمی دونم لطفاً امل راهنمای کنید)
ممنون