Foros del Web » Programación para mayores de 30 ;) » .NET »

Problemas con Datagrid

Estas en el tema de Problemas con Datagrid en el foro de .NET en Foros del Web. Bueno tengo SherpDevelop y agregue un un datadrid pero al querer llenarlo con un OleDBDataReader pone este error y no me aparece el DataBind() del ...
  #1 (permalink)  
Antiguo 21/03/2005, 13:48
Avatar de jrp01  
Fecha de Ingreso: mayo-2004
Ubicación: México
Mensajes: 2.702
Antigüedad: 20 años, 9 meses
Puntos: 0
Problemas con Datagrid

Bueno tengo SherpDevelop y agregue un un datadrid pero al querer llenarlo con un OleDBDataReader pone este error y no me aparece el DataBind() del Grid:

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Exception: Complex DataBinding accepts as a data source either an IList or an IListSource
at System.Windows.Forms.DataGrid.set_DataSource(Objec t value)
at ejemplo.MainForm.MainFormLoad(Object sender, EventArgs e) in C:\Documents and Settings\Jorge\Mis documentos\SharpDevelop Projects\ejemplo\MainForm.vb:line 157
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
----------------------------------------
ejemplo
Assembly Version: 1.0.1906.24990
Win32 Version: 1.0.1906.24990
CodeBase: file:///C:/Documents%20and%20Settings/Jorge/Mis%20documentos/SharpDevelop%20Projects/ejemplo/bin/Debug/ejemplo.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.windows.forms/1.0.5000.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
----------------------------------------
System.Data
Assembly Version: 1.0.5000.0
Win32 Version: 1.1.4322.573
CodeBase: file:///c:/windows/assembly/gac/system.data/1.0.5000.0__b77a5c561934e089/system.data.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.


Y no lo llena
  #2 (permalink)  
Antiguo 21/03/2005, 15:46
Avatar de jrp01  
Fecha de Ingreso: mayo-2004
Ubicación: México
Mensajes: 2.702
Antigüedad: 20 años, 9 meses
Puntos: 0
Bueno investigando ya lo solucione pero fue usando un DataSet y un OleDbDataAdapter alguien sabe por que?
  #3 (permalink)  
Antiguo 21/03/2005, 17:07
Avatar de jrp01  
Fecha de Ingreso: mayo-2004
Ubicación: México
Mensajes: 2.702
Antigüedad: 20 años, 9 meses
Puntos: 0
Bueno ahora tengo otra pregunta yo lleno el datagrid asi:

Código:
    Commando = New OleDbDataAdapter("select * from tabla1", cn) 
    Commando.Fill(ds, "Tabla1") 
    Grid.DataSource=ds.Tables("Tabla1").DefaultView
Ahora si yo inserto un registro o borro uno ¿como actualizo el Grid?
Para que me muestre los nuevos datos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:45.