Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

MartyK2007

@MartyK2007
About
Posts
89
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Doctor Who, The Finale.
    M MartyK2007

    oh come on you didnt really enjoy that did you bring back david tennant that was suspend beleif in extremous - How often does this new doctor get to save the universe - few more "normal" episodes please!! I have tried to like him but I am so disappointed with this series I loved blink but the sequel in this series just lost the style of it. grumpy

    life is a bowl of cherries go on take a byte

    The Lounge

  • EntityFramework and "set transaction isolation level read uncommitted"
    M MartyK2007

    Hello, I have an issue with EntityFramework and "set transaction isolation level read uncommitted" We have changed EF to call a base class (by not using the edmx , this is possible) In the base class we have overridden the createQuery method to include a call to a SSDL function <Function Name="Uncommitted" IsComposable="false"> <CommandText> set transaction isolation level read uncommitted </CommandText> </Function> The reason we do this is so emulate (nolocks) on our sql and thereby help performance of our ASP Web Pages. This however has brought up a problem. we have an admin function that has a problem. (DeliveryMethods) I have a attribute table which is keyed by deliveryMethod and attribute type. Say I have RowA on that table. I change and save a value on RowA using an enitiy object in the entityframework. I then move off to another web page and copy RowA, again using an entity object in entityframework. The problem is the copy of RowA contains the original values and not the changed ones. If I do an IIS reset between the amendments and the copy then the new RowA has the changed values so it works ok. looking at the SQL profiler - The update to the original RowA is exec sp_executesql N'update [dbo].[DeliveryMethodsRuleAttributes] set [IntAttribute] = @0, [LastUpdated] = @1, [LastUpdatedBy] = @2 where ([Id] = @3) ',N'@0 int,@1 datetime,@2 nvarchar(4),@3 uniqueidentifier',@0=40000,@1='2009-08-10 17:39:20:383',@2=N'mken',@3='2B60D845-411B-4337-A887-B6BB0F9B9309' I changed @0 from 30000 to 40000. The copy process does not issue an SQL Request , so there is no SQL read. The Copy insert is. exec sp_executesql N'insert [dbo].[DeliveryMethodsRuleAttributes]([Id], [DeliveryMethodRuleId], [DeliveryMethodId], [AttributeName], [DateTimeAttribute], [IntAttribute], [DecimalAttribute], [TextAttribute], [Created], [CreatedBy], [LastUpdated], [LastUpdatedBy]) values (@0, @1, @2, @3, null, @4, null, null, @5, @6, @7, @8) ',N'@0 uniqueidentifier,@1 uniqueidentifier,@2 uniqueidentifier,@3 nvarchar(14),@4 int,@5 datetime,@6 nvarchar(4),@7 datetime,@8 nvarchar(4)',@0='0264FECD-5EE4-49D3-9CE0-72BAAC11DAA6',@1='722456F0-ACE1-44B0-9568-A03CDD4453C5',@2='053C32B3-808C-4375-9826-02BDC55A8791',@3=N'PriceInCentsTo',@4=30000,@5='2009-08-10 17:42:03:780',@6=N'mken',@7='2009-08-10 17:42:03:780',@8=N'mken' @4 is set to 30000, which was the original RowA value. If I deactivate the "set transaction" then this problem

    .NET (Core and Framework) help sharepoint database windows-admin performance

  • GetType on a Referenced Assemble without hardcoding assembly loadfrom values
    M MartyK2007

    ok no offense meant. The issue with that is that your dll's have to be below your app.startup which in my case may not be relevent I think the fully qualified name though has legs - still testing thanks for your help Martin

    life is a bowl of cherries go on take a byte

    Visual Basic help question

  • GetType on a Referenced Assemble without hardcoding assembly loadfrom values
    M MartyK2007

    Hello, yes your assuming the assembly is in the startup path - is that a valid assumpton? I may have a solution though I think I can get the fully qualified name of the assembly from the current executing assemblies refernce collection. This value doest have a path in it at all. from there I can issue am assembly load using the fully qualified Name and it seems to get it. I am testing to see if this happens in all cases thanks Martin

    life is a bowl of cherries go on take a byte

    Visual Basic help question

  • GetType on a Referenced Assemble without hardcoding assembly loadfrom values
    M MartyK2007

    Hello, I have a problem : I have a class Library (FooClasses) which has a refence to a second set of classes (Foo2Classes) In Foo2Classes is a class (Foo3) I have the following code Imports System.Reflection Imports Foo2Classes Public Class FooClass Protected Sub SomeSub() Dim T as Type T = Type.GetType("Foo2Classes.Foo3") I have also tried T = Type.GetType("FooClasses.Foo2Classes.Foo3") End Sub End Class The T cant be found by reflection so I am assuming I must load the Foo2Classes assembly first. If this is the case how can I load the assembly without using a hardcoded path in a loadfrom. What I want to be able to do is to use the fact that it has been referenced in my FooClasses. Can you get the path from the assembly reference , rather than hardcoding it OR putting in a partially qualified pathname ie "/subdir/Foo2Classes.dll" Thanks Martin

    life is a bowl of cherries go on take a byte

    Visual Basic help question

  • Storing RTF in SQL
    M MartyK2007

    ok stupid question - just googled VARBINARY(MAX) thanks for that it seems to fit what I neeed Martin

    life is a bowl of cherries go on take a byte

    Database database help

  • Storing RTF in SQL
    M MartyK2007

    dont I have to specify a MAX value though for VARBINARY(MAX) I wouldnt want to restrict the size if possible (other than database size limits of course) thanks Martin

    life is a bowl of cherries go on take a byte

    Database database help

  • Storing RTF in SQL
    M MartyK2007

    hello, I need to store RTF (from a net richtext boxes RTF property) on an SQL table. The size could be anything up to 16 or 17 Mb. Whats the best datatype to use and has anyone got a codesnippet that could help. if its something like binary then is it possible that I can search the field with a standard SQL statement such as in: Select * where Fld Like "*Stuff to Find*" Thanks in advance Martin

    life is a bowl of cherries go on take a byte

    Database database help

  • Time to ask for another computer!
    M MartyK2007

    pwah children !! bring back George II and CMS!!! God now I feel so old....... Martin

    life is a bowl of cherries go on take a byte

    The Lounge question

  • Wizard Control for vb.net 2005
    M MartyK2007

    sorry use: http://www.codeproject.com/cs/miscctrl/DesignTimeWizard.asp[^]

    life is a bowl of cherries go on take a byte

    Visual Basic csharp tutorial announcement

  • Wizard Control for vb.net 2005
    M MartyK2007

    hey try [http://www.codeproject.com/cs/miscctrl/DesignTimeWizard.asp?forumid=101677&fr=151&select=1669610&df=100](Design Time Wizard) hope it helps Martin

    life is a bowl of cherries go on take a byte

    Visual Basic csharp tutorial announcement

  • Do you add change history in source code? why?
    M MartyK2007

    more details please thanks Martin

    life is a bowl of cherries go on take a byte

    The Lounge question collaboration help

  • Wait for Shell script to finish
    M MartyK2007

    ah if only there was a course that told me to use process instead of application or program - sigh!! Martin

    life is a bowl of cherries go on take a byte

    Visual Basic linux tools question

  • Wait for Shell script to finish
    M MartyK2007

    and sometimes people still need to ask as they havent got the correct phrase in the google search box i.e. vb6 wait for process to exit would not have been my first choice for a search phrase. :) Martin

    life is a bowl of cherries go on take a byte

    Visual Basic linux tools question

  • Best Practices to work with databases using VB .NET
    M MartyK2007

    Mark Churchill wrote:

    your data layer that ends up restricting how you do things in the UI

    agreed but you can do it another way too. for example my data layer has a factory class that contains a getdataset command where I pass the datarequest command (in the form of MS SQL) , the connection as an object and the dataprovider type) there are families of classes for each dataprovider so for example I have an OracleViaWebservice family which takes the MS SQL command, converts it to oracle SQL, uses the connectio class to find identify the correct web service location and passes the request to the web service which then uses the oracle connectstring (stored in that connection class) and issues the comand aainst an oracle DB before returning the result. now all that took time but now its written Its very extendable. If I come across a new dataprovider (ie webservice to Siebel for example) I just create a new family of generic classes to handle the process and away I go. If I come across another type of dataaccess (ie instead of processing a dataset, I need to process a er DataReader - yeah I know its a reach) then I just add the procesing code for a datareader to each existing family of classes I find that the ongoing maintenance of my data layer is practically non existant now and its generic enough not to restrict my business layer. Martin

    life is a bowl of cherries go on take a byte

    Visual Basic help csharp database architecture tutorial

  • Best Practices to work with databases using VB .NET
    M MartyK2007

    Hello, It also depends on how big the company is and how many different database applications are required. I have certainly seen cases where ORM is simply not necessary because the company and /or the requirements arent too Big. I am a big fan of a 3 tier approach myself Dumb Database Layer - gets/upserts the data - if written correctly with abstract factories for each type of database (SQL, Oracle, Web Service etc.) Once this is written it can be used everywhere and only needs changing when a new type of database is going to be used. Business Layer - derived from a stongly created Base Class which holds the business rules for processing data entities. For example a User Business component or an "Order" Business component. In my case each busines component would be capable of navigating row by row or presenting a modified dataset for binding to gui. The business layer would be where most of the on going maintenance would occur. It would hold all the business rules. Ie you change the users details , therefore generate an audit record. These components could be stored in a different process or server if required. Gui/Controller layer - This takes the data from the business layer and adds it to the Gui controls and then takes any changes and passes them to the business layer- it includes some gui based validation rules ie a field is just number or a date, that kind of thing. Personally I think, for a small to perhaps medium sized company, that this gives the best framework in terms of long term maintenance costs and ease of use. Yes its a bigger pain than just binding data to controls from within each app but once the initial overhead is taken care of I see this as a very robust solution. Hope this helps Martin

    life is a bowl of cherries go on take a byte

    Visual Basic help csharp database architecture tutorial

  • handshaking through a subdirectory
    M MartyK2007

    hey thanks luc thats another good idea Martin

    life is a bowl of cherries go on take a byte

    Visual Basic wcf sysadmin security help career

  • handshaking through a subdirectory
    M MartyK2007

    hey that makes sense and may help thanks Martin

    life is a bowl of cherries go on take a byte

    Visual Basic wcf sysadmin security help career

  • handshaking through a subdirectory
    M MartyK2007

    hello,

    Dave Kreskowiak wrote:

    wait an appropriate amount of time for the files to be completely written

    can you define and appropriate amount of time. Files can be up to 6M , network drive response could be crap due to bandwidth issues etc. Also does having 10 files mean the codes waits 10 periods or waits 1 period and hopes all 10 files have finished copying. if the latter: What happens if you see set A File 1 , wait 10 minutes (say for this example - I know in reality it will be a lot less) and Set B File 9 starts to arrive in the tenth minute. You can now copy set A file 1 no problem but then Set B file 9 is still copying so you crash whne you try and grab it. If the former then it slows the overall throughput down dramticaly

    Dave Kreskowiak wrote:

    Also, if the other process opens the file, writes some data

    In theory that wont happen in my scenario all, the Set A wont be copied to the directory until all the files have been updated.

    Dave Kreskowiak wrote:

    It should maintain the lock so the data can be backed out or rewritten

    that implies that some thought has been given by our unix team to crashes etc and that they have coded something like that - for which I am doubtfull. It would mean a change to the reboot process of all the unix systems and the windows system. I am not sure I can get the resource authorised for that.(you know how it is) You dont have a decent "Pattern" for doing this anywhere do you?? Thanks Martin

    life is a bowl of cherries go on take a byte

    Visual Basic wcf sysadmin security help career

  • handshaking through a subdirectory
    M MartyK2007

    Hello, My problem. we have a legacy unix system that perdiodically writes files to a subdirectory ( a repeating job runs every few minutes and drops the files). There are sets of files so there may be setA File1to3 and SetB file1to8. This is absoluely THE ONLY WAY the unix system will transfer the files (no http pushes or web services or anything else) I have to write an interface that runs a periodic VB net job which will read the contents of the subdirectory and if a complete set is present move that set from the subdir. Of course my job and the unix job could be running at exactly the same time so I cant just find a find and move it out , because the file may still be being copied from unix as I try and copy it. I am looking for a safe way of handshaking those files. I was thinkinng the unix system could write a lock file, which stops my job looking in the subdir,copies the unix files and deletes the locking file. BUT ok here is where I admit to lying slightly - it isnt one unix system its 4 and there is also 1 windows xp system that works in the same way (sigh!) So I could use 5 locking files and if any are present not do anything But what if one of those unix systems crashes after writing a lock file , then the whole process is stuffed (er thats a technical term I believe!). So what I am really looking for is process logic which is a safe and simple way of getting my VB Net interface to read files in sets which have been delivered to the same subdirectory from different sources (and yes it must be the same subdirectory - The network security people have only opened this 1 subdir and no child subdirs are permitted - They must be a different breed of people - still...) is there a way of telling if a file has finished being copied to a subdir - ie its 12M in length - I look at it whene only 4 M has been copied...... Thanks in advance Martin

    life is a bowl of cherries go on take a byte

    Visual Basic wcf sysadmin security help career
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups