I'm having issues to use my recordset, this is the error I'm getting:
ResponsableProp uesta.Observaci ones
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.IndexOut OfRangeExceptio n:
ResponsableProp uesta.Observaci ones
Source Error:
Line 26: 'txtMargen.Text = RSq("Responsabl ePropuesta.Marg en")
Line 27: 'txtOBS.Text =
Line 28: Response.Write( RSq("Responsabl ePropuesta.Obse rvaciones"))
Line 29:
Line 30: End If
Source File: C:\Documents and Settings\Edgar Salcedo\Mis documentos\Visu al
Studio 2005\WebSites\S IP\LineasMod.as px.vb Line: 28
Stack Trace:
[IndexOutOfRange Exception: ResponsableProp uesta.Observaci ones]
System.Data.Pro viderBase.Field NameLookup.GetO rdinal(String fieldName) +95
System.Data.Sql Client.SqlDataR eader.GetOrdina l(String name) +168
System.Data.Sql Client.SqlDataR eader.get_Item( String name) +35
LineasMod.Page_ Load(Object sender, EventArgs e) in C:\Documents and
Settings\Edgar Salcedo\Mis documentos\Visu al Studio
2005\WebSites\S IP\LineasMod.as px.vb:28
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +88
System.Web.UI.C ontrol.LoadRecu rsive() +74
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +3021
And this is my code:
If Not IsPostBack() Then
HiddenField1.Va lue = Request("id")
cmbRG.SelectedV alue = Request("rg")
cmbRP.SelectedV alue = Request("rp")
Dim sqlr As String = "SELECT ResponsableProp uesta.Idpropues ta AS
Id, Prospecto.Nombr e AS Prospecto, Usuario.IdUsuar io AS IdRG, Usuario.Nombre
AS RespGrupo, Usuario_1.IdUsu ario AS IdRP, Usuario_1.Nombr e AS RespProp,
ResponsableProp uesta.FechaPlan Entrega,
ResponsableProp uesta.ValorProp uestaCOP,
ResponsableProp uesta.ValorProp uestaUSD, ResponsableProp uesta.Margen,
ResponsableProp uesta.Observaci ones FROM ResponsableProp uesta INNER JOIN
Propuesta ON ResponsableProp uesta.Idpropues ta = Propuesta.IdPro puesta INNER
JOIN Prospecto ON Propuesta.IdPro specto = Prospecto.IdPro specto INNER JOIN
Usuario ON ResponsableProp uesta.RespGrupo = Usuario.IdUsuar io INNER JOIN
Usuario AS Usuario_1 ON ResponsableProp uesta.RespPropu esta =
Usuario_1.IdUsu ario WHERE (ResponsablePro puesta.Idpropue sta = " &
Request("id") & ") AND (Usuario.IdUsua rio = " & Request("rg") & ") AND
(Usuario_1.IdUs uario = " & Request("rp") & ")"
Dim sqlConn As System.Data.Sql Client.SqlConne ction
Dim sqlCmd As System.Data.Sql Client.SqlComma nd
Dim strConnection As String
Dim RSq As System.Data.Sql Client.SqlDataR eader
strConnection =
ConfigurationMa nager.Connectio nStrings("SIPco nnectionstring" ).ConnectionStr ing
'System.Configu ration.Configur ationManager.Ap pSettings("Prue ba3")
sqlConn = New System.Data.Sql Client.SqlConne ction(strConnec tion)
sqlCmd = New System.Data.Sql Client.SqlComma nd(sqlr, sqlConn)
sqlConn.Open()
RSq = sqlCmd.ExecuteR eader()
RSq.Read()
'txtFechaPlan.t ext = RSq("Responsabl ePropuesta.Fech aPlanEntrega")
'TxtCOP.Text = RSq("Responsabl ePropuesta.Valo rPropuestaCOP")
'TxtUSD.Text = RSq("Responsabl ePropuesta.Valo rPropuestaUSD")
'txtMargen.Text = RSq("Responsabl ePropuesta.Marg en")
'txtOBS.Text =
Response.Write( RSq("Responsabl ePropuesta.Obse rvaciones"))
End If
How can I solve this?
Thx
ResponsableProp uesta.Observaci ones
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
Exception Details: System.IndexOut OfRangeExceptio n:
ResponsableProp uesta.Observaci ones
Source Error:
Line 26: 'txtMargen.Text = RSq("Responsabl ePropuesta.Marg en")
Line 27: 'txtOBS.Text =
Line 28: Response.Write( RSq("Responsabl ePropuesta.Obse rvaciones"))
Line 29:
Line 30: End If
Source File: C:\Documents and Settings\Edgar Salcedo\Mis documentos\Visu al
Studio 2005\WebSites\S IP\LineasMod.as px.vb Line: 28
Stack Trace:
[IndexOutOfRange Exception: ResponsableProp uesta.Observaci ones]
System.Data.Pro viderBase.Field NameLookup.GetO rdinal(String fieldName) +95
System.Data.Sql Client.SqlDataR eader.GetOrdina l(String name) +168
System.Data.Sql Client.SqlDataR eader.get_Item( String name) +35
LineasMod.Page_ Load(Object sender, EventArgs e) in C:\Documents and
Settings\Edgar Salcedo\Mis documentos\Visu al Studio
2005\WebSites\S IP\LineasMod.as px.vb:28
System.Web.UI.C ontrol.OnLoad(E ventArgs e) +88
System.Web.UI.C ontrol.LoadRecu rsive() +74
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +3021
And this is my code:
If Not IsPostBack() Then
HiddenField1.Va lue = Request("id")
cmbRG.SelectedV alue = Request("rg")
cmbRP.SelectedV alue = Request("rp")
Dim sqlr As String = "SELECT ResponsableProp uesta.Idpropues ta AS
Id, Prospecto.Nombr e AS Prospecto, Usuario.IdUsuar io AS IdRG, Usuario.Nombre
AS RespGrupo, Usuario_1.IdUsu ario AS IdRP, Usuario_1.Nombr e AS RespProp,
ResponsableProp uesta.FechaPlan Entrega,
ResponsableProp uesta.ValorProp uestaCOP,
ResponsableProp uesta.ValorProp uestaUSD, ResponsableProp uesta.Margen,
ResponsableProp uesta.Observaci ones FROM ResponsableProp uesta INNER JOIN
Propuesta ON ResponsableProp uesta.Idpropues ta = Propuesta.IdPro puesta INNER
JOIN Prospecto ON Propuesta.IdPro specto = Prospecto.IdPro specto INNER JOIN
Usuario ON ResponsableProp uesta.RespGrupo = Usuario.IdUsuar io INNER JOIN
Usuario AS Usuario_1 ON ResponsableProp uesta.RespPropu esta =
Usuario_1.IdUsu ario WHERE (ResponsablePro puesta.Idpropue sta = " &
Request("id") & ") AND (Usuario.IdUsua rio = " & Request("rg") & ") AND
(Usuario_1.IdUs uario = " & Request("rp") & ")"
Dim sqlConn As System.Data.Sql Client.SqlConne ction
Dim sqlCmd As System.Data.Sql Client.SqlComma nd
Dim strConnection As String
Dim RSq As System.Data.Sql Client.SqlDataR eader
strConnection =
ConfigurationMa nager.Connectio nStrings("SIPco nnectionstring" ).ConnectionStr ing
'System.Configu ration.Configur ationManager.Ap pSettings("Prue ba3")
sqlConn = New System.Data.Sql Client.SqlConne ction(strConnec tion)
sqlCmd = New System.Data.Sql Client.SqlComma nd(sqlr, sqlConn)
sqlConn.Open()
RSq = sqlCmd.ExecuteR eader()
RSq.Read()
'txtFechaPlan.t ext = RSq("Responsabl ePropuesta.Fech aPlanEntrega")
'TxtCOP.Text = RSq("Responsabl ePropuesta.Valo rPropuestaCOP")
'TxtUSD.Text = RSq("Responsabl ePropuesta.Valo rPropuestaUSD")
'txtMargen.Text = RSq("Responsabl ePropuesta.Marg en")
'txtOBS.Text =
Response.Write( RSq("Responsabl ePropuesta.Obse rvaciones"))
End If
How can I solve this?
Thx
Comment