//conexion a base de datos
SqlConnection conn = new SqlConnection("Data Source=ALEXIS-PC;Initial Catalog=ERP;Persist Security Info=True;User ID=sa;Password=rsc9sra2");
conn.Open();// abro conexion.
string StrComando = "SELECT * FROM MAEPR WHERE KOPRTE='" + txt_tecnico.Text + "'";
SqlCommand COMAND = new SqlCommand(StrComando, conn);
DataTable tabla = new DataTable(); // El resultado lo guardaremos en una tabla
SqlDataAdapter AdaptadorTabla = new SqlDataAdapter(StrComando, conn); // Usaremos un DataAdapter para leer los datos
//DataSet ds = new DataSet();
AdaptadorTabla.Fill(tabla);// Llenamos la tabla con los datos leídos
string kopr = tabla.Rows[0]["KOPR"].ToString();//guardo informacion en variables
string nokopr = tabla.Rows[0]["NOKOPR"].ToString();
string ud1 = tabla.Rows[0]["UD1"].ToString();
string ud2 = tabla.Rows[0]["UD2"].ToString();
string rlud = tabla.Rows[0]["RLUD"].ToString();
string estado = tabla.Rows[0]["ESTPR"].ToString();
string ex = tabla.Rows[0]["EXEPR"].ToString();
string iva = tabla.Rows[0]["IVA"].ToString();
string tipo = tabla.Rows[0]["TIPR"].ToString();
txt_principal.Text = kopr;//asigno valores a txt
txt_descripcion.Text = nokopr;
txt_ud1.Text = ud1;
txt_ud2.Text = ud2;
txt_rtu.Text = rlud;
txt_iva.Text = iva;
cb_estado.Text = estado;