karim orooji
پنج شنبه 15 مهر 1389, 20:00 عصر
سُلام دوستان
نمیدونم برای کد insert برای چی کار نمیکنه
این خطا میشه
http://barnamenevis.org/forum/attachment.php?attachmentid=57928&stc=1&d=1286470781
اینم کدش
Dim com1 As New SqlCommand
com1.Connection = con
com1.CommandText = "insert into grid values(@name,@family,@tel,@city,@pic,@active)"
com1.Parameters.AddWithValue("@name", Trim(txt_name.Text))
com1.Parameters.AddWithValue("@family", Trim(txt_family.Text))
com1.Parameters.AddWithValue("@tel", Trim(txt_tel.Text))
com1.Parameters.AddWithValue("@city", Trim(edit_list.SelectedValue.ToString))
If img.Text = "" Then
com.Parameters.AddWithValue("@pic", "pic\default.gif")
Else
com.Parameters.AddWithValue("@pic", img.Text)
End If
'Try
con.Open()
com1.ExecuteNonQuery()
con.Close()
نمیدونم برای کد insert برای چی کار نمیکنه
این خطا میشه
http://barnamenevis.org/forum/attachment.php?attachmentid=57928&stc=1&d=1286470781
اینم کدش
Dim com1 As New SqlCommand
com1.Connection = con
com1.CommandText = "insert into grid values(@name,@family,@tel,@city,@pic,@active)"
com1.Parameters.AddWithValue("@name", Trim(txt_name.Text))
com1.Parameters.AddWithValue("@family", Trim(txt_family.Text))
com1.Parameters.AddWithValue("@tel", Trim(txt_tel.Text))
com1.Parameters.AddWithValue("@city", Trim(edit_list.SelectedValue.ToString))
If img.Text = "" Then
com.Parameters.AddWithValue("@pic", "pic\default.gif")
Else
com.Parameters.AddWithValue("@pic", img.Text)
End If
'Try
con.Open()
com1.ExecuteNonQuery()
con.Close()