farhad85
جمعه 04 بهمن 1392, 15:04 عصر
سلام
من یه جدول درست کردم که از طریق فرم همه اطلاعاتو وارد میکنم ودکمه ذخیره رو میزنم و هیچ مشگل وخطایی هم رخ نمیده از تری هم استفاده نکردم ولی وقتی جدولو نگاه میکنم اصلا اطلاغاتم وارد اون نشدن اینم کدش لطفا کمک کنید
Dim my_cm4 As New SqlCommand("insert into moshakhasat(code_meli,name,family,n_p,sh_sh,t_t,m_ sodur,tahsilat,reshte,shoghl,taahol,t_khanevade,so kunat,ostan,shahrestan,bakhsh,dehestan,rusta,m_kha damat,n_shora,h_shora,n_dehyar,h_dehyar,sh_hesab,s h_cart,h_keshavarz,code_posti,email,t_sabtename,m_ sabt,adres,toz,pic) values (@code_meli,@name,@family,@n_p,@sh_sh,@t_t,@m_sodu r,@tahsilat,@reshte,@shoghl,@taahol,@t_khanevade,@ sokunat,@ostan,@shahrestan,@bakhsh,@dehestan,@rust a,@m_khadamat,@n_shora,@h_shora,@n_dehyar,@h_dehya r,@sh_hesab,@sh_cart,@h_keshavarz,@code_posti,@ema il,@t_sabtename,@m_sabt,@adres,@toz,@pic)", my_cn)
Dim my_da4 As New SqlDataAdapter("Select * from moshakhasat", my_cn)
Dim my_ds4 As New DataSet
Dim my_cb4 As New SqlCommandBuilder(my_da4)
my_cm4.Parameters.Add("@code_meli", SqlDbType.NVarChar).Value = TextBox1.Text
my_cm4.Parameters.Add("@name", SqlDbType.NVarChar).Value = TextBox2.Text
my_cm4.Parameters.Add("@family", SqlDbType.NVarChar).Value = TextBox3.Text
my_cm4.Parameters.Add("@n_p", SqlDbType.NVarChar).Value = TextBox4.Text
my_cm4.Parameters.Add("@sh_sh", SqlDbType.NVarChar).Value = TextBox5.Text
my_cm4.Parameters.Add("@t_t", SqlDbType.NVarChar).Value = MaskedTextBox1.Text
my_cm4.Parameters.Add("@m_sodur", SqlDbType.NVarChar).Value = TextBox6.Text
my_cm4.Parameters.Add("@tahsilat", SqlDbType.NVarChar).Value = ComboBox1.Text
my_cm4.Parameters.Add("@reshte", SqlDbType.NVarChar).Value = TextBox7.Text
my_cm4.Parameters.Add("@shoghl", SqlDbType.NVarChar).Value = ComboBox2.Text
my_cm4.Parameters.Add("@taahol", SqlDbType.NVarChar).Value = ComboBox3.Text
my_cm4.Parameters.Add("@t_khanevade", SqlDbType.NVarChar).Value = TextBox8.Text
my_cm4.Parameters.Add("@sokunat", SqlDbType.NVarChar).Value = ComboBox4.Text
my_cm4.Parameters.Add("@ostan", SqlDbType.NVarChar).Value = ComboBox5.Text
my_cm4.Parameters.Add("@shahrestan", SqlDbType.NVarChar).Value = ComboBox6.Text
my_cm4.Parameters.Add("@bakhsh", SqlDbType.NVarChar).Value = TextBox9.Text
my_cm4.Parameters.Add("@dehestan", SqlDbType.NVarChar).Value = TextBox10.Text
my_cm4.Parameters.Add("@rusta", SqlDbType.NVarChar).Value = TextBox11.Text
my_cm4.Parameters.Add("@m_khadamat", SqlDbType.NVarChar).Value = TextBox12.Text
my_cm4.Parameters.Add("@n_shora", SqlDbType.NVarChar).Value = TextBox13.Text
my_cm4.Parameters.Add("@h_shora", SqlDbType.NVarChar).Value = TextBox14.Text
my_cm4.Parameters.Add("@n_dehyar", SqlDbType.NVarChar).Value = TextBox15.Text
my_cm4.Parameters.Add("@h_dehyar", SqlDbType.NVarChar).Value = TextBox16.Text
my_cm4.Parameters.Add("@sh_hesab", SqlDbType.NVarChar).Value = TextBox17.Text
my_cm4.Parameters.Add("@sh_cart", SqlDbType.NVarChar).Value = TextBox18.Text
my_cm4.Parameters.Add("@h_keshavarz", SqlDbType.NVarChar).Value = TextBox19.Text
my_cm4.Parameters.Add("@code_posti", SqlDbType.NVarChar).Value = TextBox20.Text
my_cm4.Parameters.Add("@t_sabtename", SqlDbType.NVarChar).Value = MaskedTextBox2.Text
my_cm4.Parameters.Add("@m_sabt", SqlDbType.NVarChar).Value = TextBox21.Text
my_cm4.Parameters.Add("@email", SqlDbType.NVarChar).Value = TextBox22.Text
my_cm4.Parameters.Add("@adres", SqlDbType.NVarChar).Value = TextBox23.Text
my_cm4.Parameters.Add("@toz", SqlDbType.NVarChar).Value = TextBox24.Text
Dim ms As New MemoryStream
Me.PictureBox1.Image.Save(ms, Imaging.ImageFormat.Jpeg)
Dim arrPic() As Byte = ms.GetBuffer
my_cm4.Parameters.Add("@Pic", SqlDbType.VarBinary).Value = arrPic
my_cm4.ExecuteNonQuery()
my_da4.Fill(my_ds4, "moshakhasat")
DataGridView1.DataSource = (my_ds4)
DataGridView1.DataMember = "moshakhasat"
my_cn.Close()
Label34.Text = "اتصال از بــایگاه اطلاعــات فطع شد"
من یه جدول درست کردم که از طریق فرم همه اطلاعاتو وارد میکنم ودکمه ذخیره رو میزنم و هیچ مشگل وخطایی هم رخ نمیده از تری هم استفاده نکردم ولی وقتی جدولو نگاه میکنم اصلا اطلاغاتم وارد اون نشدن اینم کدش لطفا کمک کنید
Dim my_cm4 As New SqlCommand("insert into moshakhasat(code_meli,name,family,n_p,sh_sh,t_t,m_ sodur,tahsilat,reshte,shoghl,taahol,t_khanevade,so kunat,ostan,shahrestan,bakhsh,dehestan,rusta,m_kha damat,n_shora,h_shora,n_dehyar,h_dehyar,sh_hesab,s h_cart,h_keshavarz,code_posti,email,t_sabtename,m_ sabt,adres,toz,pic) values (@code_meli,@name,@family,@n_p,@sh_sh,@t_t,@m_sodu r,@tahsilat,@reshte,@shoghl,@taahol,@t_khanevade,@ sokunat,@ostan,@shahrestan,@bakhsh,@dehestan,@rust a,@m_khadamat,@n_shora,@h_shora,@n_dehyar,@h_dehya r,@sh_hesab,@sh_cart,@h_keshavarz,@code_posti,@ema il,@t_sabtename,@m_sabt,@adres,@toz,@pic)", my_cn)
Dim my_da4 As New SqlDataAdapter("Select * from moshakhasat", my_cn)
Dim my_ds4 As New DataSet
Dim my_cb4 As New SqlCommandBuilder(my_da4)
my_cm4.Parameters.Add("@code_meli", SqlDbType.NVarChar).Value = TextBox1.Text
my_cm4.Parameters.Add("@name", SqlDbType.NVarChar).Value = TextBox2.Text
my_cm4.Parameters.Add("@family", SqlDbType.NVarChar).Value = TextBox3.Text
my_cm4.Parameters.Add("@n_p", SqlDbType.NVarChar).Value = TextBox4.Text
my_cm4.Parameters.Add("@sh_sh", SqlDbType.NVarChar).Value = TextBox5.Text
my_cm4.Parameters.Add("@t_t", SqlDbType.NVarChar).Value = MaskedTextBox1.Text
my_cm4.Parameters.Add("@m_sodur", SqlDbType.NVarChar).Value = TextBox6.Text
my_cm4.Parameters.Add("@tahsilat", SqlDbType.NVarChar).Value = ComboBox1.Text
my_cm4.Parameters.Add("@reshte", SqlDbType.NVarChar).Value = TextBox7.Text
my_cm4.Parameters.Add("@shoghl", SqlDbType.NVarChar).Value = ComboBox2.Text
my_cm4.Parameters.Add("@taahol", SqlDbType.NVarChar).Value = ComboBox3.Text
my_cm4.Parameters.Add("@t_khanevade", SqlDbType.NVarChar).Value = TextBox8.Text
my_cm4.Parameters.Add("@sokunat", SqlDbType.NVarChar).Value = ComboBox4.Text
my_cm4.Parameters.Add("@ostan", SqlDbType.NVarChar).Value = ComboBox5.Text
my_cm4.Parameters.Add("@shahrestan", SqlDbType.NVarChar).Value = ComboBox6.Text
my_cm4.Parameters.Add("@bakhsh", SqlDbType.NVarChar).Value = TextBox9.Text
my_cm4.Parameters.Add("@dehestan", SqlDbType.NVarChar).Value = TextBox10.Text
my_cm4.Parameters.Add("@rusta", SqlDbType.NVarChar).Value = TextBox11.Text
my_cm4.Parameters.Add("@m_khadamat", SqlDbType.NVarChar).Value = TextBox12.Text
my_cm4.Parameters.Add("@n_shora", SqlDbType.NVarChar).Value = TextBox13.Text
my_cm4.Parameters.Add("@h_shora", SqlDbType.NVarChar).Value = TextBox14.Text
my_cm4.Parameters.Add("@n_dehyar", SqlDbType.NVarChar).Value = TextBox15.Text
my_cm4.Parameters.Add("@h_dehyar", SqlDbType.NVarChar).Value = TextBox16.Text
my_cm4.Parameters.Add("@sh_hesab", SqlDbType.NVarChar).Value = TextBox17.Text
my_cm4.Parameters.Add("@sh_cart", SqlDbType.NVarChar).Value = TextBox18.Text
my_cm4.Parameters.Add("@h_keshavarz", SqlDbType.NVarChar).Value = TextBox19.Text
my_cm4.Parameters.Add("@code_posti", SqlDbType.NVarChar).Value = TextBox20.Text
my_cm4.Parameters.Add("@t_sabtename", SqlDbType.NVarChar).Value = MaskedTextBox2.Text
my_cm4.Parameters.Add("@m_sabt", SqlDbType.NVarChar).Value = TextBox21.Text
my_cm4.Parameters.Add("@email", SqlDbType.NVarChar).Value = TextBox22.Text
my_cm4.Parameters.Add("@adres", SqlDbType.NVarChar).Value = TextBox23.Text
my_cm4.Parameters.Add("@toz", SqlDbType.NVarChar).Value = TextBox24.Text
Dim ms As New MemoryStream
Me.PictureBox1.Image.Save(ms, Imaging.ImageFormat.Jpeg)
Dim arrPic() As Byte = ms.GetBuffer
my_cm4.Parameters.Add("@Pic", SqlDbType.VarBinary).Value = arrPic
my_cm4.ExecuteNonQuery()
my_da4.Fill(my_ds4, "moshakhasat")
DataGridView1.DataSource = (my_ds4)
DataGridView1.DataMember = "moshakhasat"
my_cn.Close()
Label34.Text = "اتصال از بــایگاه اطلاعــات فطع شد"