An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Exception Details:
System.MissingFieldException: Field not found: ?.GdiplusInvalidRectangle.
Stack Trace:
[MissingFieldException: Field not found: ?.GdiplusInvalidRectangle.]
System.Drawing.Color.op_Equality(Color left, Color right) +0
Imports System
Imports System.Data
Imports System.Data.OleDb
Public Class WebForm1
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Protected WithEvents frmCatId As System.Web.UI.WebControls.DropDownList
Protected WithEvents Button1 As System.Web.UI.WebControls.Button
Protected WithEvents frmitemName As System.Web.UI.WebControls.TextBox
Protected WithEvents frmitemText As System.Web.UI.WebControls.TextBox
Protected WithEvents Label1 As System.Web.UI.WebControls.Label
'NOTE: The following placeholder declaration is required by the Web Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Northwind.mdb") & ";"
Dim MySQL As String = "SELECT CódigoDaCategoria, NomeDaCategoria FROM Categorias Order by CódigoDaCategoria"
Dim MyConn As New OleDbConnection(strConn)
Dim objDR As OleDbDataReader
Dim Cmd As New OleDbCommand(MySQL, MyConn)
MyConn.Open()
objDR = Cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection)
frmCatId.DataTextField = "NomeDaCategoria"
frmCatId.DataValueField = "CódigoDaCategoria"
frmCatId.DataSource = objDR
frmCatId.DataBind()
MyConn.Close()
End Sub
Sub doInsert()
Dim strConn As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("Northwind.mdb") & ";"
Dim mySQL As String = "INSERT INTO Produtos(NomeDoProduto, QuantidadePorUnidade, CódigoDaCategoria) VALUES (@Nome, @Quantidade, @Codigo)"
Dim mySQL2 As String = "SELECT MAX (CódigoDoProduto) FROM Produtos"
Dim Conn As New OleDbConnection(strConn)
Dim Cmd As New OleDbCommand(mySQL, Conn)
Dim Cmd2 As New OleDbCommand(mySQL2, Conn)
With Cmd.Parameters
.Add(New OleDbParameter("@Nome", frmitemName.Text))
.Add(New OleDbParameter("@Quantidade", frmitemText.Text))
.Add(New OleDbParameter("@Codigo", frmCatId.SelectedItem.Value))
End With
Conn.Open()
Cmd.ExecuteNonQuery()
Label1.Text = "Os dados foram cadastrados com sucesso!"
Label1.Text = "<p>O Código do ultimo produto incluido é igual a =" & Cmd2.ExecuteScalar
Conn.Close()
End Sub
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
doInsert()
End Sub
End Class
alguém saberia me dizer porque deu este tipo de erro ? Foi logo após eu inserir o Label1 no webform que começou apresentar este tipo de erro.
Pergunta
ursolouco
Brothers!!!!
Field not found: ?.GdiplusInvalidRectangle.
Exception Details:
Stack Trace:
Index.aspx.vb
alguém saberia me dizer porque deu este tipo de erro ? Foi logo após eu inserir o Label1 no webform que começou apresentar este tipo de erro.
Valeu Galera!!
Abraços e Boa Programação!!
Link para o comentário
Compartilhar em outros sites
2 respostass a esta questão
Posts Recomendados