Ver Mensaje Individual
  #9 (permalink)  
Antiguo 15/07/2009, 10:39
REHome
 
Fecha de Ingreso: mayo-2007
Ubicación: PIC-16F84A
Mensajes: 727
Antigüedad: 17 años
Puntos: 8
Respuesta: Insertar datos donde quieras

Pues es verdad, tienes buena vista.

En la propia MySQL me actuliza bien el:

Código:
UPDATE `dispositivos` SET descripcion='descripcion1' WHERE id='1';
UPDATE `dispositivos` SET descripcion='descripcion2' WHERE id='2';
UPDATE `dispositivos` SET descripcion='descripcion3' WHERE id='3';
UPDATE `dispositivos` SET descripcion='descripcion4' WHERE id='4';
Bajo C# no lo hace.
Código:
 private void button_actualizar_Click(object sender, EventArgs e)
        {
            string insertar_disp = @"UPDATE `dispositivos` SET descripcion='descripcion1' WHERE id='1';
                                     UPDATE `dispositivos` SET descripcion='descripcion2' WHERE id='2';
                                     UPDATE `dispositivos` SET descripcion='descripcion3' WHERE id='3';
                                     UPDATE `dispositivos` SET descripcion='descripcion4' WHERE id='4';";
                                            

            connection = new MySqlConnection(MyConString);
            MySqlCommand con7 = new MySqlCommand(insertar_disp, connection);
            connection.Open();
            con7.ExecuteNonQuery();
            connection.Close();
        }
Me da error de este tipo.
Cita:
No se controló System.ArgumentNullException
Message="La clave no puede ser nula.\r\nNombre del parámetro: key"
Source="mscorlib"
ParamName="key"
StackTrace:
en System.Collections.Hashtable.get_Item(Object key)
en MySql.Data.MySqlClient.MySqlPoolManager.GetPool(My SqlConnectionStringBuilder settings)
en MySql.Data.MySqlClient.MySqlConnection.Open()
en MySQL12.Form1.button_actualizar_Click(Object sender, EventArgs e) en C:\Documents and Settings\Hunter\Mis documentos\Visual Studio 2008\Projects\MySQL12\MySQL12\Form1.cs:línea 157
en System.Windows.Forms.Control.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnClick(EventArgs e)
en System.Windows.Forms.Button.OnMouseUp(MouseEventAr gs mevent)
en System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
en System.Windows.Forms.Control.WndProc(Message& m)
en System.Windows.Forms.ButtonBase.WndProc(Message& m)
en System.Windows.Forms.Button.WndProc(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
en System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
en System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
en System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
en System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
en System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
en System.Windows.Forms.Application.Run(Form mainForm)
en MySQL12.Program.Main() en C:\Documents and Settings\Hunter\Mis documentos\Visual Studio 2008\Projects\MySQL12\MySQL12\Program.cs:línea 18
en System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
en Microsoft.VisualStudio.HostingProcess.HostProc.Run UsersAssembly()
en System.Threading.ThreadHelper.ThreadStart_Context( Object state)
en System.Threading.ExecutionContext.Run(ExecutionCon text executionContext, ContextCallback callback, Object state)
en System.Threading.ThreadHelper.ThreadStart()
InnerException:
__________________
Meta Shell, VERSIÓN 1.2.2
Descargar