|
 |
aspx_espanol thread: =?iso-8859-1?Q?Re:_=5Baspx=5Fespanol=5D_Creacion_de_Dll=B4s?=
Message #1 by "Daniel Chavez" <chavezd@r...> on Fri, 16 Aug 2002 11:32:07 -0500
|
|
porque no lo compilas desde VSNET?
ojo que el conectionstring está dentro del web config, así que quizás ese puede ser el problema, porque la clase está leyendo otro
archivo
----- Original Message -----
From: Pedro Alberto
To: ASP.Net en Español
Sent: Friday, August 16, 2002 11:08 AM
Subject: [aspx_espanol] Creacion de Dll´s
Que tal, aqui nuevamente planteando mis dudas!!!!
Fueron de gran ayuda los consejos que me dieron
anteriormente acerca de la creación de dlls para
mis procedimientos. Use la herramienta llamada
LLBLGen, para que me generara las clases y todo
hasta aqui esta bien (por cierto, esta muy padre la
herramienta). Pero al momento de generar la dll me
envio varios errores, no he podido ubicar que puede
ser, ya que en el codigo no identifico que estaria mal
y solo me indica error en los objetos del
SQLClient(SqlConnection, SqlByte, SQLCommand,etc),
espero puedan ayudarme con este problemita, gracias.
Para la creacion de la dll, la realizo desde el prompt
y usando el vbc con los sig. parametros
C:\WINNT\Microsoft.NET\Framework\v1.0.3705\vbc
/r:system.web.dll /t:library clsCat_estatus.vb
Y unos de los errores, son los sig:
C:\ejemplosnet\clsCat_estatus.vb(157) : error BC30002:
Type 'SqlByte' is not defined.
Dim byFiEstat_idTmp As SqlByte = Value
~~~~~~~
C:\ejemplosnet\clsCat_estatus.vb(166) : error BC30002:
Type 'SqlString' is not defined.
Public Property [sFcDescripcion]() As
SqlString
~~~~~~~~~
C:\ejemplosnet\clsCat_estatus.vb(170) : error BC30002:
Type 'SqlString' is not defined.
Set(ByVal Value As SqlString)
~~~~~~~~~
C:\ejemplosnet\clsCat_estatus.vb(171) : error BC30002:
Type 'SqlString' is not defined.
Dim sFcDescripcionTmp As SqlString
Value
~~~~~~~~~
El codigo fuente es:
'
///////////////////////////////////////////////////////////////////////////
' // Description: Data Access class for the table
'cat_estatus'
' // Generated by LLBLGen v1.2.953.16965 Final on:
Miércoles 14 de Agosto de 2002, 06:52:09 PM
' // Because the Base Class already implements
IDispose, this class doesn't.
'
///////////////////////////////////////////////////////////////////////////
Imports System
Imports System.Data
Imports System.Data.SqlTypes
Imports System.Data.SqlClient
Namespace BaseDatos
' /// <summary>
' /// Purpose: Data Access class for the table
'cat_estatus'.
' /// </summary>
Public Class clsCat_estatus
Inherits clsDBInteractionBase
#Region " Class Member Declarations "
Private m_byFiEstat_id As SqlByte
Private m_sFcDescripcion As SqlString
#End Region
' /// <summary>
' /// Purpose: Class constructor.
' /// </summary>
Public Sub New()
' // Nothing for now.
End Sub
' /// <summary>
' /// Purpose: Insert method. This method will
insert one new row into the database.
' /// </summary>
' /// <returns>True if succeeded, otherwise an
Exception is thrown. </returns>
' /// <remarks>
' /// Properties needed for this method:
' /// <UL>
' /// <LI>byFiEstat_id</LI>
' /// <LI>sFcDescripcion</LI>
' /// </UL>
' /// Properties set after a succesful call of this
method:
' /// <UL>
' /// <LI>iErrorCode</LI>
' /// </UL>
' /// </remarks>
Overrides Public Function Insert() As Boolean
Dim scmCmdToExecute As SqlCommand = New
SqlCommand()
scmCmdToExecute.CommandText
"dbo.[sp_cat_estatus_Insert]"
scmCmdToExecute.CommandType
CommandType.StoredProcedure
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(New
SqlParameter("@byfiEstat_id", SqlDbType.TinyInt, 1,
ParameterDirection.Input, false, 3, 0, "",
DataRowVersion.Proposed, m_byFiEstat_id))
scmCmdToExecute.Parameters.Add(New
SqlParameter("@sfcDescripcion", SqlDbType.VarChar, 15,
ParameterDirection.Input, false, 0, 0, "",
DataRowVersion.Proposed, m_sFcDescripcion))
scmCmdToExecute.Parameters.Add(new
SqlParameter("@iErrorCode", SqlDbType.Int, 4,
ParameterDirection.Output, false, 10, 0, "",
DataRowVersion.Proposed, m_iErrorCode))
If m_bMainConnectionIsCreatedLocal Then
' // Open connection.
m_scoMainConnection.Open()
Else
If
m_cpMainConnectionProvider.bIsTransactionPending Then
scmCmdToExecute.Transaction
m_cpMainConnectionProvider.stCurrentTransaction
End If
End If
' // Execute query.
scmCmdToExecute.ExecuteNonQuery()
m_iErrorCode = New
SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value,
Integer))
If Not m_iErrorCode.Equals(New
SqlInt32(LLBLError.AllOk)) Then
' // Throw error.
Throw New Exception("Stored Procedure
'sp_cat_estatus_Insert' reported the ErrorCode: " &
m_iErrorCode.ToString())
End If
Return True
Catch ex As Exception
' // some error occured. Bubble it to caller and
encapsulate Exception object
Throw New Exception("clsCat_estatus::Insert::Error
occured.", ex)
Finally
If m_bMainConnectionIsCreatedLocal Then
' // Close connection.
m_scoMainConnection.Close()
End If
scmCmdToExecute.Dispose()
End Try
End Function
' /// <summary>
' /// Purpose: SelectAll method. This method will
Select all rows from the table.
' /// </summary>
' /// <returns>DataTable object if succeeded,
otherwise an Exception is thrown. </returns>
' /// <remarks>
' /// Properties set after a succesful call of this
method:
' /// <UL>
' /// <LI>iErrorCode</LI>
' /// </UL>
' /// </remarks>
Overrides Public Function SelectAll() As DataTable
Dim scmCmdToExecute As SqlCommand = New
SqlCommand()
scmCmdToExecute.CommandText
"dbo.[sp_cat_estatus_SelectAll]"
scmCmdToExecute.CommandType
CommandType.StoredProcedure
Dim dtToReturn As DataTable = new
DataTable("cat_estatus")
Dim sdaAdapter As SqlDataAdapter = new
SqlDataAdapter(scmCmdToExecute)
' // Use base class' connection object
scmCmdToExecute.Connection = m_scoMainConnection
Try
scmCmdToExecute.Parameters.Add(new
SqlParameter("@iErrorCode", SqlDbType.Int, 4,
ParameterDirection.Output, false, 10, 0, "",
DataRowVersion.Proposed, m_iErrorCode))
If m_bMainConnectionIsCreatedLocal Then
' // Open connection.
m_scoMainConnection.Open()
Else
If
m_cpMainConnectionProvider.bIsTransactionPending Then
scmCmdToExecute.Transaction
m_cpMainConnectionProvider.stCurrentTransaction
End If
End If
' // Execute query.
sdaAdapter.Fill(dtToReturn)
m_iErrorCode = New
SqlInt32(CType(scmCmdToExecute.Parameters.Item("@iErrorCode").Value,
Integer))
If Not m_iErrorCode.Equals(New
SqlInt32(LLBLError.AllOk)) Then
' // Throw error.
Throw New Exception("Stored Procedure
'sp_cat_estatus_SelectAll' reported the ErrorCode: " &
m_iErrorCode.ToString())
End If
Return dtToReturn
Catch ex As Exception
' // some error occured. Bubble it to caller and
encapsulate Exception object
Throw New
Exception("clsCat_estatus::SelectAll::Error occured.",
ex)
Finally
If m_bMainConnectionIsCreatedLocal Then
' // Close connection.
m_scoMainConnection.Close()
End If
scmCmdToExecute.Dispose()
sdaAdapter.Dispose()
End Try
End Function
#Region " Class Property Declarations "
Public Property [byFiEstat_id]() As SqlByte
Get
Return m_byFiEstat_id
End Get
Set(ByVal Value As SqlByte)
Dim byFiEstat_idTmp As SqlByte = Value
If byFiEstat_idTmp.IsNull Then
Throw New
ArgumentOutOfRangeException("byFiEstat_id",
"byFiEstat_id can't be NULL")
End If
m_byFiEstat_id = Value
End Set
End Property
Public Property [sFcDescripcion]() As SqlString
Get
Return m_sFcDescripcion
End Get
Set(ByVal Value As SqlString)
Dim sFcDescripcionTmp As SqlString = Value
If sFcDescripcionTmp.IsNull Then
Throw New
ArgumentOutOfRangeException("sFcDescripcion",
"sFcDescripcion can't be NULL")
End If
m_sFcDescripcion = Value
End Set
End Property
#End Region
End Class
End Namespace
_________________________________________________________
Do You Yahoo!?
La emoción e intensidad del deporte en Yahoo! Deportes. http://deportes.yahoo.com.mx
---
Usted está suscrito a aspx_espanol como:
chavezd@r...
Para darse de baja, envíe un mensaje en blanco a
%%email.unsub%%
|
|
 |