[Mono-bugs] [Bug 369529] New: VBNC99997

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 11 19:57:33 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=369529


           Summary: VBNC99997
           Product: Mono: Compilers
           Version: unspecified
          Platform: Other
        OS/Version: Other
            Status: ASSIGNED
          Severity: Normal
          Priority: P5 - None
         Component: Basic
        AssignedTo: rkvinge at novell.com
        ReportedBy: rkvinge at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Server Error in '/' Application

--------------------------------------------------------------------------------

Compilation Error
Description: Error compiling a resource required to service this request.
Review your source file and modify it to fix this error. 

Error message: 

/tmp/apache-temp-aspnet-0/d3b17121/2dff4261._8.vb(63,15) : warning VBNC42024:
Function without an 'As' clause; Object return type assumed.
/tmp/apache-temp-aspnet-0/d3b17121/2dff4261._8.vb(63,15) : warning VBNC42024:
Function without an 'As' clause; Object return type assumed.
/tmp/apache-temp-aspnet-0/d3b17121/2dff4261._8.vb(92,41) : error VBNC99997:
You've encountered something in the compiler which is not implemented. Please
file a bug (see instructions here: http://mono-project.com/Bugs)
/tmp/apache-temp-aspnet-0/d3b17121/2dff4261._8.vb(242,26) : error VBNC99997:
You've encountered something in the compiler which is not implemented. Please
file a bug (see instructions here: http://mono-project.com/Bugs)


Source File: /tmp/apache-temp-aspnet-0/d3b17121/2dff4261._8.vb

Line 1: Imports RaYCode.DBManager
Line 2: Imports System.data
Line 3: Namespace RaYCode.DBManager
Line 4:     Public Class Table
Line 5:         Protected WithEvents DBManager As DBManagerBase
Line 6:         Protected WithEvents currentdataTable As DataTable
Line 7:         Protected WithEvents currentDataAdapter As
SqlClient.SqlDataAdapter
Line 8:         Protected WithEvents currentCommand As SqlClient.SqlCommand
Line 9: 
Line 10:         Private tableName As String
Line 11:         Private currentFilter As String
Line 12:         Private currentOrder As String
Line 13:         Private bRowsAdded As Boolean = False
Line 14: 
Line 15: 
Line 16: 
Line 17: #Region " Public Retrieval "
Line 18:         'Return Value
Line 19:         Default Public Overridable Property Data(ByVal field As
String, Optional ByVal row As Integer = 0) As Object
Line 20:             Get
Line 21:                 Dim result As Object =
currentdataTable.Rows(row)(field)
Line 22:                 If result Is DBNull.Value Then
Line 23:                     result = ""
Line 24:                 End If
Line 25:                 Return (result & "")
Line 26:             End Get
Line 27:             Set(ByVal Value As Object)
Line 28:                 Dim v
Line 29:                 v = Value
Line 30:                 If Not Value Is DBNull.Value Then
Line 31: 
Line 32:                     v = Value & ""
Line 33:                     ' v = v.Replace("`", "")
Line 34:                     ' v = v.Replace("'", "")
Line 35:                     'v = v.Replace("\", "")
Line 36:                     'v = v.Replace("[", "")
Line 37:                     'v = v.Replace("]", "")
Line 38: 
Line 39:                     Value = v
Line 40:                 End If
Line 41:                 DBManager.localTrace(tableName & " data " & field &
"=" & Value)
Line 42:                 currentdataTable.Rows(row)(field) = v
Line 43:             End Set
Line 44:         End Property
Line 45:         'Returns Row
Line 46:         Public Function GetRow(ByVal row As Integer) As DataRow
Line 47:             DBManager.localTrace("table.DataRow (" & tableName & ")")
Line 48:             Return currentdataTable.Rows(row)
Line 49:         End Function
Line 50:         'Return DataTable
Line 51:         Public ReadOnly Property DataTable() As DataTable
Line 52: 
Line 53:             Get
Line 54:                 DBManager.localTrace("table.DataTable (" & tableName &
")")
Line 55:                 Return currentdataTable
Line 56:             End Get
Line 57:         End Property
Line 58:         'Returns Name of Table
Line 59:         Public Function GetTableName() As String
Line 60:             DBManager.localTrace("table.GetTableName (" & tableName &
")")
Line 61:             Return tableName
Line 62:         End Function
Line 63:         Public ReadOnly Property Count()
Line 64:             Get
Line 65:                 DBManager.localTrace("table.Count (" & tableName &
")")
Line 66:                 Return currentdataTable.Rows.Count
Line 67:             End Get
Line 68:         End Property
Line 69: #End Region
Line 70: 
Line 71: #Region "Transaction"
Line 72:         Public sqlTransaction As Data.SqlClient.SqlTransaction
Line 73:         Protected Property Transaction() As
Data.SqlClient.SqlTransaction
Line 74:             Get
Line 75:                 Return DBManager.Transaction
Line 76:                 'Return sqlTransaction
Line 77:             End Get
Line 78:             Set(ByVal value As Data.SqlClient.SqlTransaction)
Line 79:                 sqlTransaction = value
Line 80: 
Line 81: 
Line 82:                 If Not currentDataAdapter.SelectCommand Is Nothing
Then currentDataAdapter.SelectCommand.Transaction = sqlTransaction
Line 83:                 If Not currentDataAdapter.InsertCommand Is Nothing
Then currentDataAdapter.InsertCommand.Transaction = sqlTransaction
Line 84:                 If Not currentDataAdapter.UpdateCommand Is Nothing
Then currentDataAdapter.UpdateCommand.Transaction = sqlTransaction
Line 85:                 If Not currentDataAdapter.DeleteCommand Is Nothing
Then currentDataAdapter.DeleteCommand.Transaction = sqlTransaction
Line 86:             End Set
Line 87:         End Property
Line 88: #End Region
Line 89: #Region " Row Modification "
Line 90:         Public Sub DeleteRow(ByVal row As Integer)
Line 91:             DBManager.localTrace("table.Delete (" & tableName & ")")
Line 92:             RowChanging(currentdataTable.Rows(row),
DataRowState.Deleted + 100)
Line 93:             currentdataTable.Rows(row).Delete()
Line 94:             Save()
Line 95:         End Sub
Line 96:         Public Function NewRow() As DataRow
Line 97:             DBManager.localTrace("table.NewRow (" & tableName & ")")
Line 98:             Return currentdataTable.NewRow
Line 99:         End Function
Line 100:         Public Function Add(ByVal dr As DataRow) As Integer
Line 101:             DBManager.localTrace("table.ADD DR(" & tableName & ")")
Line 102:             'If Not currentdataTable.Rows.Count = 0 Then Save()
Line 103:             'Dim col As Data.DataColumn
Line 104:             'Dim x As String = ""
Line 105:             'For Each col In dr.Table.Columns
Line 106:             '    If col.DataType Is x.GetType Then
Line 107:             '        If Not dr(col) Is DBNull.Value Then
Line 108:             '            dr(col) = DBManager.EscapeSQL(dr(col))
Line 109:             '        End If
Line 110:             '    End If
Line 111: 
Line 112:             'Next
Line 113: 
Line 114:             RowAdding(dr)
Line 115: 
Line 116:             If Not dr.Table.Columns("datecreate") Is Nothing Then
Line 117:                 dr("datecreate") = Date.Now
Line 118:                 dr("usercreate") =
DBManager.SecurityModule.DisplayName
Line 119:                 dr("datemodify") = Date.Now
Line 120:                 dr("usermodify") =
DBManager.SecurityModule.DisplayName
Line 121:             End If
Line 122: 
Line 123: 
Line 124:             currentdataTable.Rows.Add(dr)
Line 125:             Save()
Line 126: 
Line 127:             Try
Line 128:                 Return DBManager.getLastInsert
Line 129:             Catch
Line 130:                 Return -1
Line 131:             End Try
Line 132:         End Function
Line 133:         Public Function AddBlankRow() As Data.DataRow
Line 134:             DBManager.localTrace("table.AddBlankRow(" & tableName &
")")
Line 135:             Dim nr As DataRow = currentdataTable.NewRow
Line 136:             Add(nr)
Line 137:             Return nr
Line 138:         End Function
Line 139:         Public Sub Save()
Line 140:             DBManager.localTrace("table.Save (" & tableName & ")")
Line 141:             currentDataAdapter.Update(currentdataTable)
Line 142:             UpdateTable()
Line 143:         End Sub
Line 144:         Public Sub Save(ByVal dt As DataTable)
Line 145:             DBManager.localTrace("table.Save DT(" & tableName & ")")
Line 146:             currentdataTable.Merge(dt)
Line 147:             Save()
Line 148:         End Sub
Line 149: #End Region
Line 150: 
Line 151:         Sub New(ByRef DBman As DBManagerBase, ByVal table As String,
Optional ByVal filter As String = "", Optional ByVal Delay As Boolean = False)
Line 152: 
Line 153:             DBman.localTrace("table.new (" & table & ")")
Line 154:             DBManager = DBman ' New DBManager
Line 155:             sqlTransaction = DBManager.Transaction
Line 156:             tableName = table
Line 157: 
Line 158:             If Delay = False Then InitaliseClass(filter)
Line 159:         End Sub
Line 160: 
Line 161: #Region " Database Backgrounds "
Line 162:         Protected Sub InitaliseClass(ByVal filter As String, Optional
ByVal order As String = "")
Line 163: 
Line 164:             If filter <> "" Then currentFilter = " WHERE " & filter
Line 165:             If order <> "" Then currentOrder = " Order By " & order
Line 166: 
Line 167:             InitTable()
Line 168:             UpdateTable()
Line 169:         End Sub
Line 170: 
Line 171:         Private Sub UpdateTable()
Line 172:             Try
Line 173:                 currentdataTable = New DataTable
Line 174: 
Line 175:                 currentDataAdapter.Fill(currentdataTable)
Line 176: 
Line 177:             Catch ex As Exception
Line 178:                 Throw New Exception(ex.Message & "-" &
currentDataAdapter.SelectCommand.CommandText)
Line 179:             End Try
Line 180:         End Sub
Line 181:         Protected _ForceSQL As String = ""
Line 182:         Private Sub InitTable()
Line 183:             DBManager.localTrace("2" & currentFilter)
Line 184:             currentdataTable = New DataTable
Line 185: 
Line 186:             If _ForceSQL = "" Then
Line 187: 
Line 188: 
Line 189:                 currentCommand = New SqlClient.SqlCommand("SELECT TOP
1 * FROM [" & tableName & "]", sqlConnection)
Line 190:                 currentCommand.Transaction = Transaction
Line 191: 
Line 192: 
Line 193:                 currentDataAdapter = New
SqlClient.SqlDataAdapter(currentCommand)
Line 194:                 currentDataAdapter.FillSchema(currentdataTable,
SchemaType.Source)
Line 195:                 currentdataTable.Columns(0).AllowDBNull = True
Line 196: 
Line 197:                 DBManager.localTrace("3" & currentFilter)
Line 198:                 currentCommand = New SqlClient.SqlCommand("select *
from [" & tableName & "] " & currentFilter & " " & currentOrder, sqlConnection)
Line 199:                 currentCommand.Transaction = sqlTransaction
Line 200:                 DBManager.localTrace("inittable:  " & "select * from
[" & tableName & "] " & currentFilter & " " & currentOrder)
Line 201: 
Line 202:             Else
Line 203:                 currentCommand = New SqlClient.SqlCommand(_ForceSQL,
sqlConnection)
Line 204:                 currentDataAdapter = New
SqlClient.SqlDataAdapter(currentCommand)
Line 205:                 currentDataAdapter.FillSchema(currentdataTable,
SchemaType.Source)
Line 206:                 currentdataTable.Columns(0).AllowDBNull = True
Line 207:                 currentCommand.Transaction = Transaction
Line 208:             End If
Line 209: 
Line 210:             currentDataAdapter.SelectCommand = currentCommand
Line 211:             Dim cb As New
SqlClient.SqlCommandBuilder(currentDataAdapter)
Line 212: 
Line 213:             currentDataAdapter.DeleteCommand = cb.GetDeleteCommand
Line 214:             currentDataAdapter.InsertCommand = cb.GetInsertCommand
Line 215:             currentDataAdapter.UpdateCommand = cb.GetUpdateCommand
Line 216: 
Line 217:             currentDataAdapter.DeleteCommand.Transaction =
sqlTransaction
Line 218:             currentDataAdapter.InsertCommand.Transaction =
sqlTransaction
Line 219:             currentDataAdapter.UpdateCommand.Transaction =
sqlTransaction
Line 220: 
Line 221:         End Sub
Line 222: 
Line 223:         Protected Function sqlConnection() As SqlClient.SqlConnection
Line 224:             Return DBManager.GetConnection
Line 225:         End Function
Line 226: 
Line 227: #End Region
Line 228: 
Line 229: 
Line 230:         Public Sub Refresh()
Line 231:             DBManager.localTrace("table.refresh (" & tableName & ")")
Line 232:             UpdateTable()
Line 233:         End Sub
Line 234: 
Line 235: 
Line 236: 
Line 237: #Region " Events "
Line 238: 
Line 239:         Private Sub currentDataAdapter_RowUpdating(ByVal sender As
Object, ByVal e As System.Data.SqlClient.SqlRowUpdatingEventArgs) Handles
currentDataAdapter.RowUpdating
Line 240:             DBManager.localTrace("EVENT:
currentDataAdapter_RowUpdating")
Line 241:             If e.Row.RowState = DataRowState.Deleted Then Exit Sub
Line 242:             RowChanging(e.Row, e.Row.RowState)
Line 243:             'RaiseEvent RowChanging(e.Row, e.Row.RowState)
Line 244:         End Sub
Line 245:         Overridable Sub RowChanging(ByRef dr As DataRow, ByVal action
As System.Data.DataRowState)
Line 246:         End Sub
Line 247:         Overridable Sub RowAdding(ByRef dr As DataRow)
Line 248:         End Sub
Line 249: 
Line 250:         'Public Event RowChanging(ByRef dr As DataRow, ByVal action
As System.Data.DataRowState)
Line 251:         'Public Overridable Sub OnSave(ByVal R As DataRow, ByVal
ColName As String, ByVal OriginalValue As Object, ByVal NewValue As Object,
ByRef Cancel As Boolean)
Line 252:         'End Sub
Line 253: #End Region
Line 254: 
Line 255:         Private Sub DBManager_endingTransaction() Handles
DBManager.endingTransaction
Line 256:             Transaction = Nothing
Line 257:             currentDataAdapter.SelectCommand.Transaction = Nothing
Line 258:             currentDataAdapter.UpdateCommand.Transaction = Nothing
Line 259:             currentDataAdapter.DeleteCommand.Transaction = Nothing
Line 260:             Refresh()
Line 261:         End Sub
Line 262:         Private Sub DBManager_startingTransaction(ByVal trans As
System.Data.Common.DbTransaction) Handles DBManager.startingTransaction
Line 263:             currentDataAdapter.SelectCommand.Transaction = trans
Line 264:             currentDataAdapter.UpdateCommand.Transaction = trans
Line 265:             currentDataAdapter.DeleteCommand.Transaction = trans
Line 266:             Transaction = trans
Line 267:         End Sub
Line 268:         Public Sub Dispose()
Line 269:             DBManager.localTrace("table.Dispose (" & tableName & ")")
Line 270:             currentdataTable = Nothing
Line 271:             currentDataAdapter = Nothing
Line 272:             currentCommand = Nothing
Line 273:             sqlTransaction = Nothing
Line 274:             DBManager = Nothing
Line 275:             GC.Collect()
Line 276:         End Sub
Line 277: 
Line 278: 
Line 279:         Function GetChanges(ByVal dr As Data.DataRow) As String()
Line 280: 
Line 281:             DBManager.localTrace("table.getChanges (" &
dr.Table.TableName & ")")
Line 282:             Dim RES As New Collections.Generic.List(Of String)
Line 283:             Dim dc As Data.DataColumn
Line 284: 
Line 285:             For Each dc In dr.Table.Columns
Line 286:                 If dr(dc, DataRowVersion.Original) & "" <> dr(dc) &
"" Then
Line 287:                     Select Case dc.ColumnName
Line 288:                         Case "datemodify", "usermodify",
"datecreate", "datemodify"
Line 289:                             'Ignore These Fields
Line 290:                         Case Else
Line 291:                             DBManager.localTrace("[" & dc.ColumnName
& "] FROM [" & dr(dc, DataRowVersion.Original) & "] TO [" & dr(dc) & "]")
Line 292:                             RES.Add("[" & dc.ColumnName & "] FROM ["
& dr(dc, DataRowVersion.Original) & "] TO [" & dr(dc) & "]")
Line 293:                     End Select
Line 294: 
Line 295:                 End If
Line 296:             Next
Line 297:             DBManager.localTrace("table.getChanges = End")
Line 298:             Return RES.ToArray
Line 299: 
Line 300:         End Function
Line 301:     End Class
Line 302: 
Line 303: 
Line 304: 
Line 305: End Namespace

mar 11 21:02:14 <rolf_> code-er: I can't say right away what's wrong, I'll need
a complete test case
mar 11 21:02:40 <code-er>       rolf_: i have found this
mar 11 21:02:56 <code-er>       this compiles:
mar 11 21:02:56 <code-er>                   Dim r As Data.DataRow =
currentdataTable.Rows(row)
mar 11 21:02:56 <code-er>                   RowChanging(r, DataRowState.Deleted
+ 100)
mar 11 21:03:01 <code-er>       This will not
mar 11 21:03:08 <code-er>       RowChanging(currentdataTable.Rows(row),
DataRowState.Deleted + 100)
mar 11 21:03:33 <rolf_> wierd
mar 11 21:03:42 <rolf_> I'll have a look, thanks for reporting :)
mar 11 21:03:45 <code-er>       rolf_: saw this in to places
mar 11 21:04:07 <code-er>       another example:
mar 11 21:04:08 <code-er>                   Dim r As Data.DataRow = e.Row
mar 11 21:04:08 <code-er>                   RowChanging(r, e.Row.RowState)
mar 11 21:04:14 <code-er>       in event
mar 11 21:04:15 <code-er>       Private Sub
currentDataAdapter_RowUpdating(ByVal sender As Object, ByVal e As
System.Data.SqlClient.SqlRowUpdatingEventArgs) Handles
currentDataAdapter.RowUpdating
mar 11 21:04:32 <code-er>       same dea.. if i do (e.row...) it wont like it
:)


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list