Referencia a objeto no establecida como instancia
Publicado por Jorge (5 intervenciones) el 29/03/2009 12:32:56
Tengo un error en VStudio 2008.
Error:
Detalles de la excepción: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
Error de código fuente:
Línea 28: protected void Page_Load(object sender, EventArgs e)
Línea 29: {
Línea 30: sqlDataAdapter1.Fill(dataSet11); // Aquí da error.
Línea 31:
Línea 32: DataGrid1.DataSource = dataSet11;
Archivo de origen: D:Mis documentosPRACTICASAplicaciones Web ASP.NETDEMOCODEMod09PracticeCSWebForm1.aspx.cs Línea: 30
-------------------------------------------------------------------------------------------------------------------
En modo de diseño creo conexión, dataset, dataadapter y datagrid.
El código generado por VStudio 2008 es el siguiente:
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebForm1));
this.conn = new System.Data.SqlClient.SqlConnection();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.dataSet11 = new Mod09PracticeCS.DataSet1();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
------------------------------------------------------------------------------------------------------------------
¿POR QUÉ INDICA ERROR DE REFERENCIA NO ESTABLECIDA COMO INSTANCIA DE UN OBJETO, SI VStudio 2008 INICIALIZA Y CREA TODOS LOS OBJETOS EN EL MÉTODO InitializeComponent() ?
¿Alguien puede indicarme algo al respecto?
Gracias.
Error:
Detalles de la excepción: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
Error de código fuente:
Línea 28: protected void Page_Load(object sender, EventArgs e)
Línea 29: {
Línea 30: sqlDataAdapter1.Fill(dataSet11); // Aquí da error.
Línea 31:
Línea 32: DataGrid1.DataSource = dataSet11;
Archivo de origen: D:Mis documentosPRACTICASAplicaciones Web ASP.NETDEMOCODEMod09PracticeCSWebForm1.aspx.cs Línea: 30
-------------------------------------------------------------------------------------------------------------------
En modo de diseño creo conexión, dataset, dataadapter y datagrid.
El código generado por VStudio 2008 es el siguiente:
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WebForm1));
this.conn = new System.Data.SqlClient.SqlConnection();
this.sqlSelectCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlInsertCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlUpdateCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDeleteCommand1 = new System.Data.SqlClient.SqlCommand();
this.sqlDataAdapter1 = new System.Data.SqlClient.SqlDataAdapter();
this.dataSet11 = new Mod09PracticeCS.DataSet1();
((System.ComponentModel.ISupportInitialize)(this.dataSet11)).BeginInit();
------------------------------------------------------------------------------------------------------------------
¿POR QUÉ INDICA ERROR DE REFERENCIA NO ESTABLECIDA COMO INSTANCIA DE UN OBJETO, SI VStudio 2008 INICIALIZA Y CREA TODOS LOS OBJETOS EN EL MÉTODO InitializeComponent() ?
¿Alguien puede indicarme algo al respecto?
Gracias.
Valora esta pregunta


0