AYUDA CON PROCEDIMIENTO
Publicado por Edgar (35 intervenciones) el 10/11/2007 04:36:54
Hola, tengo que llenar un combobox en base a otros dos, y sucede que llamo al procedimiento y me dice que que "la funcion o procedimiento "sihdesk_Select.. " tiene demasiados parametros, me parece raro porque la primera vez que carga la pagina no hay problema pero luego que cambio el valor en alguno de los dos combobox de los cuales depende se totea.....no se que es....les dejo el codgio a ver que me dicen.....
SqlConnection MyConn = new SqlConnection();
MyConn.ConnectionString = "Data Source=Whatever;Initial Catalog=SIHDesk;Integrated Security=True";
MyPara[0] = new SqlParameter("@Cod_Empresa", SqlDbType.TinyInt);
MyPara[0].Value = int.Parse(Empresa_DwnLst.SelectedValue);
MyPara[1] = new SqlParameter("@Cod_Ciudad", SqlDbType.TinyInt);
MyPara[1].Value = int.Parse(Ciudad_DwnLst.SelectedValue);*/
SqlCommand MySQLCom = new SqlCommand();
MySQLCom.CommandType = CommandType.StoredProcedure;
MySQLCom.CommandText = "sihdesk_SelectSoloNegPorCodEmp";
MySQLCom.Connection = MyConn;
SqlParameter MyEmpresa = new SqlParameter("@Cod_Empresa", SqlDbType.TinyInt);
SqlParameter MyCiudad = new SqlParameter("@Cod_Ciudad", SqlDbType.TinyInt);
MyEmpresa.Value = int.Parse(Empresa_DwnLst.SelectedValue);
MyCiudad.Value = int.Parse(Ciudad_DwnLst.SelectedValue);
MySQLCom.Parameters.Add(MyEmpresa);
MySQLCom.Parameters.Add(MyCiudad);
DataSet MyDataSet = new DataSet();
SqlDataAdapter MySQLDataAdap = new SqlDataAdapter(MySQLCom);
MySQLDataAdap.Fill(MyDataSet); ACA BOTA EL ERROOOORRR
Negocio_DwnLst.DataSource = MyDataSet;
Negocio_DwnLst.DataTextField = "Negocio";
Negocio_DwnLst.DataValueField = "Negocio";
Negocio_DwnLst.DataBind();
NO SE QUE ES.....otra cosa me recuerdan como es que hago para psar el nombre de cadena de conexion en vez de toda la cadena de conexion?.....graciaaaaass.....espero me peudan ayudar...ya no se que es.....XD
SqlConnection MyConn = new SqlConnection();
MyConn.ConnectionString = "Data Source=Whatever;Initial Catalog=SIHDesk;Integrated Security=True";
MyPara[0] = new SqlParameter("@Cod_Empresa", SqlDbType.TinyInt);
MyPara[0].Value = int.Parse(Empresa_DwnLst.SelectedValue);
MyPara[1] = new SqlParameter("@Cod_Ciudad", SqlDbType.TinyInt);
MyPara[1].Value = int.Parse(Ciudad_DwnLst.SelectedValue);*/
SqlCommand MySQLCom = new SqlCommand();
MySQLCom.CommandType = CommandType.StoredProcedure;
MySQLCom.CommandText = "sihdesk_SelectSoloNegPorCodEmp";
MySQLCom.Connection = MyConn;
SqlParameter MyEmpresa = new SqlParameter("@Cod_Empresa", SqlDbType.TinyInt);
SqlParameter MyCiudad = new SqlParameter("@Cod_Ciudad", SqlDbType.TinyInt);
MyEmpresa.Value = int.Parse(Empresa_DwnLst.SelectedValue);
MyCiudad.Value = int.Parse(Ciudad_DwnLst.SelectedValue);
MySQLCom.Parameters.Add(MyEmpresa);
MySQLCom.Parameters.Add(MyCiudad);
DataSet MyDataSet = new DataSet();
SqlDataAdapter MySQLDataAdap = new SqlDataAdapter(MySQLCom);
MySQLDataAdap.Fill(MyDataSet); ACA BOTA EL ERROOOORRR
Negocio_DwnLst.DataSource = MyDataSet;
Negocio_DwnLst.DataTextField = "Negocio";
Negocio_DwnLst.DataValueField = "Negocio";
Negocio_DwnLst.DataBind();
NO SE QUE ES.....otra cosa me recuerdan como es que hago para psar el nombre de cadena de conexion en vez de toda la cadena de conexion?.....graciaaaaass.....espero me peudan ayudar...ya no se que es.....XD
Valora esta pregunta


0