Jump to content
Xtreme .Net Talk

rmatthew

Avatar/Signature
  • Posts

    115
  • Joined

  • Last visited

Personal Information

  • Occupation
    Information System Director
  • .NET Preferred Language
    VB.NET

rmatthew's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Is is possible to have an enumeration of valid values for a column/field? For example - If I needed a field that could only be one of: Red Green Blue without creating another table and limiting by using a foreign key. Thanks in advance!
  2. Is it possible to establish a Foreign Key on a view?
  3. I am working on a strongly typed collection using collectionbase When I change a property of an item in the collection (such as item.name) I want to validate it against the collection so as to prevent duplicate property values. Similar to the way when you change the name of a datatable that belongs to a datatablecollection, a DuplicateNameException is trown. Is there a recommended/standard way to accomplish this?
  4. Ok, got my collection working (finally) .... So I think I am going fine, but I need another bread crumb. I would liek to make a property of an item that points back to its parent such as can be done with the datatable.row as below in the debug.writeline statement. Dim dt As New DataTable Dim dr As DataRow dr = dt.NewRow Debug.WriteLine(dr.Table.TableName) Any ideas?
  5. Back and forth Yes, did try - I have a class that does one but not the other I had one that used the inumerable and would indeed work in a for each loop, but it was based on a position variable and an array of objects.... Now that I have the strongly typed class, I end up with no array/position and am not familiar enough with the list that I get to implement the other.
  6. I have the following strongly typed class... I would like to use a for... each loop to iterate through collections.... Is that possible. Public Class Tags Inherits CollectionBase Default Public Property item(ByVal index As Integer) As Tag Get Return CType(List.Item(index), Tag) End Get Set(ByVal value As Tag) List.Item(index) = value End Set End Property Public Function Add(ByVal item As Tag) As Integer Return List.Add(item) End Function End Class
  7. I have a class that has within it subclasses... I am trying to implement a collection of those subclasses as a property of the top most class such that I can utilize a .add() type funcation. such as follows: dim dt as datatable dt.rows.add(dt.newrow) I would like to use this strucature with my classes I have implemented IEnumerator, IEnumerable etc. and am pretty happy with the results - just need this last little thing :) Help Could be that I am working on little sleep...
  8. I have an array of a custom class that I have written. I have attempted to do an indexof to check for equality (i.e. is there a copy of the class already assigned to the array.) Array.IndexOf doesn't seem to work, and if I check for direct equality then I do not get what I would expect there either... Must I create an equality of some sort in the class it self?
  9. Anybody have a bit of SQL that will list the triggers on a table along with the trigger's name and the text of the trigger?
  10. What is the Defaults section under the database used for?
  11. Sorry - guess the brain skipped Duh... no Dynaimc SQL in UDFs
  12. I am atemptting the following select @tstint = max(field) from @table @table is passed in the UDF paramaters I get the following: Must declare the variable '@table'. What gives?
  13. I have output from a stored procedure that I desperately need to use as the default value of a column... I cannot seem to write the sp as a UDF due to the use of a temporary table and 'exec sp_executesql as follows: insert into #Foo exec sp_executesql @statement=@SQLQuery Please help
  14. Is it possible to set things up so that a specific UDF or SP will run at a specified interval. I don't want it to start automatically when the server starts, but to run in an endless loop (at interval) once trigged until the server is stopped.
  15. Is it possible to change the value of an inserted item from within an insert trigger? Such as inserted.[field] = 1 There are several reasons, but one of them is to replace a value with a default if the value doesn't meet a FK Constraint so as to allow the insert to happen.
×
×
  • Create New...