Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/04/2007, 16:18
Avatar de erick_arcini
erick_arcini
 
Fecha de Ingreso: julio-2005
Ubicación: Jaltenco / DF
Mensajes: 1.723
Antigüedad: 18 años, 11 meses
Puntos: 50
Re: mySQL con conexión DNS

mira, lo que puse anteriormente lo hice para no hacer tan engorrosa la información, pero en vista que no he aportado lo suficiente aquí va todo, en si, mi consulta a esa tabla esta de la siguiente forma:

Código:
"INSERT INTO employee (sName, sLastName, sLastName2, gender, dBirth, sCity, sAdress, sPC, sphone, sMobilePhone, sMail, sIMSSNumber, sRFCNumber, bPassport, sPassport, bVisa, dExpiration, sPosition, dPosition, idAbout, bFilled, bGroup, sWorkedIn, sWhen, idAvailability, sIdentification) VALUES (@Name, @LastName, @LastName2, @Gender, @Birth, @City, @Adress, @PC, @Phone, @Mobile, @mail, @IMSS, @RFC, @Passport, @PassportNumber, @Visa, @VisaExpirate, @Position, @DatePosition, @idAbout, @FilledApp, @Gruop, @WorkGroup, @WhenWork, @idAvailability, @Identification);";
Nota: no preguntes del por que de tantos datos, lo mismo les dije a los que querían el formulario y no accedieron a quitar información indebida, les dije que la dividía por tablas pero nunca quisieron, y los parameters los tengo de la siguiente forma
Código:
         OdbcCommand comando = new OdbcCommand();

            //nombre completo
            comando.Parameters.Add("@q1", OdbcType.VarChar, 70);
            comando.Parameters["@q1"].Value = txtNombre.Text.ToUpper();
            
            comando.Parameters.Add("@q2", OdbcType.VarChar, 70);
            comando.Parameters["@q2"].Value = txtPaterno.Text.ToUpper();

            comando.Parameters.Add("@q3", OdbcType.VarChar, 70);
            comando.Parameters["@q3"].Value = txtMaterno.Text.ToUpper();

            //sexo
            if (rdbM.Checked)//male
            {
                comando.Parameters.Add("@q4", OdbcType.VarChar, 1);
                comando.Parameters["@q4"].Value = "M";
            }
            else
            {
                comando.Parameters.Add("@q4", OdbcType.VarChar, 1);
                comando.Parameters["@q4"].Value = "F";
            }
            //fecha de nacimiento
            comando.Parameters.Add("@q5", OdbcType.Date);
            comando.Parameters["@q5"].Value = ddlYear1.SelectedValue + "/" +
                                              ddlMonth1.SelectedValue + "/" +
                                              ddlDia1.SelectedValue;
            //continente
            //comando.Parameters.Add("@q6", OdbcType.Int).Value = ddlContinente.SelectedValue;
            //ciudad
            comando.Parameters.Add("@q7", OdbcType.VarChar);
            comando.Parameters["@q7"].Value = txtCiudad.Text.ToUpper();

            //adress
            comando.Parameters.Add("@q8", OdbcType.VarChar);
            comando.Parameters["@q8"].Value = txtDireccion.Text.ToUpper();

            //codigo postal
            comando.Parameters.Add("@q9", OdbcType.VarChar);
            comando.Parameters["@q9"].Value = txtcp.Text;
            //telefono
            comando.Parameters.Add("@q10", OdbcType.VarChar);
            comando.Parameters["@q10"].Value = txtTelefono.Text;
            //movil
            comando.Parameters.Add("@q11", OdbcType.VarChar);
            comando.Parameters["@q11"].Value = txtMovil.Text;
            //mail
            comando.Parameters.Add("@q12", OdbcType.VarChar);
            comando.Parameters["@q12"].Value = txtMail.Text;
            //numero del imss, si existiese
            if (txtIMSS.Text != "")
            {
                comando.Parameters.Add("@q13", OdbcType.VarChar);
                comando.Parameters["@q13"].Value = txtIMSS.Text;
            }
            else
            {
                comando.Parameters.Add("@q13", OdbcType.VarChar);
                comando.Parameters["@q13"].Value = "NO NUMBER";
            }

            //numero del rfc si existiese
            if (txtRFC.Text != "")
            {
                comando.Parameters.Add("@q14", OdbcType.VarChar);
                comando.Parameters["@q14"].Value = txtRFC.Text.ToUpper();
            }
            else
            {
                comando.Parameters.Add("@q14", OdbcType.VarChar);
                comando.Parameters["@q14"].Value = "NO NUMBER";
            }
            //pasaporte
            if (rdbPassportY.Checked)//si hay pasaporte
            {
                if (txtPasaporte.Text == "")
                {
                    lblError.Text = "Passport REQUIRED";
                    txtPasaporte.Focus();
                    return;
                }
                else
                {
                    comando.Parameters.Add("@q15", OdbcType.Int);
                    comando.Parameters["@q15"].Value = 1;
                    comando.Parameters.Add("@q16", OdbcType.VarChar);
                    comando.Parameters["@q16"].Value = txtPasaporte.Text.ToUpper();
                }
            }
            else
            {
                comando.Parameters.Add("@q15", OdbcType.Int);
                comando.Parameters["@q15"].Value = 0;
                comando.Parameters.Add("@q16", OdbcType.VarChar);
                comando.Parameters["@q16"].Value = "NO NUMBER";
            }
            //visa booleano y expiracion
            if (rdbVisaY.Checked)
            {
                comando.Parameters.Add("@q17", OdbcType.Int);
                comando.Parameters["@q17"].Value = 1;
                comando.Parameters.Add("@q18", OdbcType.Date);
                comando.Parameters["@q18"].Value = ddlYear2.SelectedValue + "/" +
                                                   ddlMonth2.SelectedIndex + "/" +
                                                   ddlDia2.SelectedIndex;
            }
            else
            {
                comando.Parameters.Add("@q17", OdbcType.Int);
                comando.Parameters["@q17"].Value = 0;
                comando.Parameters.Add("@q18", OdbcType.Int);
                comando.Parameters["@q18"].Value = null;
            }
            //position applied for
            comando.Parameters.Add("@q19", OdbcType.VarChar);
            comando.Parameters["@q19"].Value = txtPosition.Text.ToUpper();
            comando.Parameters.Add("@q20", OdbcType.Date);
            comando.Parameters["@q20"].Value = ddlYear3.SelectedValue + "/" +
                                                                     ddlMonth3.SelectedIndex + "/" +
                                                                     ddlDia3.SelectedIndex;
            //DONDE NOS ENCONTRO@
            comando.Parameters.Add("@q21", OdbcType.Int);
            comando.Parameters["@q21"].Value = ddlAcercaDe.SelectedValue;
            //PREGUNTA 1
            if (rdb1.Checked)
            {
                comando.Parameters.Add("@q22", OdbcType.Int);
                comando.Parameters["@q22"].Value = 1;
            }
            else
            {
                comando.Parameters.Add("@q22", OdbcType.Int);
                comando.Parameters["@q22"].Value = 0;
            }
            //PREGUNTA 2
            if (rdb11.Checked)
            {
                comando.Parameters.Add("@q23", OdbcType.Int);
                comando.Parameters["@q23"].Value = 1;
            }
            else
            {
                comando.Parameters.Add("@q23", OdbcType.Int);
                comando.Parameters["@q23"].Value = 0;
            }
            comando.Parameters.Add("@q24", OdbcType.VarChar);
            comando.Parameters["@q24"].Value = txtLufthansa.Text.ToUpper();
            comando.Parameters.Add("@q25", OdbcType.VarChar);
            comando.Parameters["@q25"].Value = txtCuando.Text.ToUpper();
            comando.Parameters.Add("@q26", OdbcType.Int);
            comando.Parameters["@q26"].Value = ddlAvailable.SelectedValue;
            comando.Parameters.Add("@q27", OdbcType.VarChar);
            comando.Parameters["@q27"].Value = "*****";

            OdbcConnection conexion = new OdbcConnection(connection);

            comando.Connection = conexion;
            comando.CommandText = consultaUpdate;//consulta que acabo de postear
            conexion.Open();
            if (comando.ExecuteNonQuery() == 1)
...
es lo que te digo, he revisado todo el código y no me manda problemas, las cajas de texto las tengo llenas, bueno, las que pido como obligatorias, pero me sigue mandando ese error por cada uno de los campo.
__________________
Mejoremos nuestro país, ayudemos al planeta... próximamente.