c# - How can I call data from a row of a table in a combo box to save it in a new table? -


A Kanblboks found> client ) and when you fill everything and hit the save button I want this information to be inserted into a field of another table, but I do not even know that information Comboboks is to show , the code I've found so far is this:

  private void btnbuscar_Click (Ob Ject sender, EventArgs e) {OpenFileDialog dialog = new OpenFileDialog (); DialogResult Results = Dialog ShowDialog (); If (Results == DialogResult.OK) {pictureBox1.Image = Image.FromFile (dialog.FileName); }} Private void btnaceptar_Click (object sender, EventArgs e) {try {SqlConnection con = new SqlConnection (@ "Data Source = USER- PC; Initial Catalog = dbtaller; Integrated Security = true"); SqlCommand com = New SqlCommand (); com. Connection = Conn .; Com.CommandText = "Insert Ikvipos (Image, Nombre, client, State, Fikdersipasiyn, Mpledocargo) values ​​(@ Impen, Nombre, Cleti, State, @ Fcderesepasiyn, @ Appldocargo)"; Com.Parameters.Add ("@Knowledge", System.Data.SqlDbType.Image); Com.Parameters.Add ("@ nombre", System.Data.SqlDbType.VarChar); Com.Parameters.Add ("@ cliente", System.Data.SqlDbType.Int); Com.Parameters.Add ("@ estado", System.Data.SqlDbType.VarChar); Com.Parameters.Add ("@fachdrecipeson", system.data. SCLDBtype.det); Com.Parameters.Add ("@ empleadoacargo", System.Data.SqlDbType.VarChar); Com.Parameters ["nombre"] Value = txtnombre.Text; Com.Parameters ["Estado"]. Value = tiststado Text; Com.Parameters ["empleadoacargo"] Value = txtempleado.Text; System.IO.MemoryStream ms1 = New System.IO.MemoryStream (); Photobox 1 Image. Save (MS1, System. Drawing .imaging format .jpg); Com.Parameters ["Fantasy"]. Value = MS1 Gatebuffer (); } Hold (SqlException East) {MessageBox.Show (ex.Message); }}  


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -