Jump to content
Xtreme .Net Talk

bri189a

Avatar/Signature
  • Posts

    1014
  • Joined

  • Last visited

Everything posted by bri189a

  1. Yeah, that doesn't work. The way I came up with the hack I did was by trying to clear the Cache manually and ran into the same thing he did...there's nothing in the Cache object! Count == 0. Have you gotton this to work using this method? Maybe I'm just an idiot.
  2. I want to clear cache on an object datasource through code, through Google I figured out from asp.net that if I do the following (where the original DefaultValue for the SelectParameter = "ORIGINAL"), the cache will get cleared: ObjectDataSource1.SelectParameters[0].DefaultValue = "Original"; ObjectDataSource1.SelectParameters[0].DefaultValue = "ORIGINAL"; This in essence marks the parameter dirty causing the ObjectDataSource control to internally call OnParameterChanged which clears the cache (thank you Reflector!). This is a hack at best to get around the problem that there is no way to directly (that I've found) to clear the cache on ObjectDataSource progamatically. What's the right way to do this progamatically?
  3. I didn't know aspnet_regiis did those extra things...very good to know...as to your problem...is it possible that you're encrypting on one machine and then trying to decrypt on another. Maybe this is stating the obvious but if not...the encryption is probably based upon machine specific keys...but I don't think that's the case reading your post but you know how it is, the obvious problem is sometime ignored...anyway... I did figure out that 'section' refers to something like: <section name="customHandler" type="blah...." /> And I'm calling this like: aspnet_regiis -pe "customHanlder" -app "/MySite" But I'm getting an error on that. Documentation isn't much help. Let me know if you find any more on this, I'm interested to know about it myself now.
  4. You could also use javascript to look for character 13 on key press of the field and manually click that button to keep your seperation of concerns, or make it so that the form doesn't automatically submit when you press character 13 (the return key).
  5. Ah yes...always for get that XSLT isn't just for data... :)
  6. As an alternative, CSS allow you to specify where page breaks occur, width of 'boxes' of data, etc. You can of coarse specify this stuff for 'print' only rather that screen. If you don't want to spend a small fortune on a package such as SRS or Crystal, spend $20 on a good CSS book (such as DHMTL and CSS for WWW), and use CSS to do all your printing. Don't by a Ferrari if all you need is a Toyota.
  7. The xsd file you use when you create a strongly typed dataset is just a schema file...maybe try to run them both through there using an XmlValidatingReader or something like that? Just an idea.
  8. Been swamped, I really have to catch up...quick easy problem for someone more familiar with overriding settings in config files: Our top level web site has an implementation of the UIProcess that requires a configSection: <uipConfiguration>...this version is 'customized' and I don't need it on our virtual web application below the top level site...I need the vanilla version from Microsoft. So I thought I could (and according to MSDN which I checked when it didn't work the first time) just put: <configSections> <!-- remove the 'customized' version'--> <remove name="uipConfiguration" /> <!-- use the original instead --> <section name="uipConfiguration" type="Microsoft.ApplicationBlocks.UIProcess.UIPConfigHandler, Microsoft.ApplicationBlocks.UIProcess, Version=1.0.1.0,Culture=neutral,PublicKeyToken=null" /> </configSections> But what I end up with is the following error: Section or group name 'uipConfiguration' is already defined. Updates to this may only occur at the configuration level where it is defined. I have also tried the clear element which even if I comment out my 'new section' will still load the section handler for uipConfiguration which should of been removed. I'm wondering if there was a KB or something that addressed this since the documentation says this should be possible but it doesn't work on my machine. Any help would be appreciated, I'm out of ideas and on a time-line. Thanks!
  9. But boxing an unboxing refers to making a value type a reference type and vice versa... Your examples are all reference types and therefore nothing is boxed or unboxed, simply referenced by their base classes which is perfectly acceptable and the performance impact of that cast is minimal if nothing. It's really no differenant in saying a person is an employee and referencing an instance of an employee as a person.
  10. I'd say since you're not using code behinds this is the cause. If you put your ProjectName.ForumLink, it finds the reference but then it will come back with an error that says it doesn't posses a property named ForumDataRowView. When using the same page as the code behind it seems anything you declare public there is actually not.
  11. What I mean is that if the control is a Label, you would fully reference if by going System.Web.UI.WebControls.Label - if for instance this ForumLink is in a 3rd party control called SomebodyCustomControls.WebControls.ForumLink, and you didn't have using SomebodyCustomControls.WebControls; declared at the top of your class then this would give you the compile errors you are getting
  12. That's a good question about the EventHandler...I hoping M.E. has some input on that but I can say I've seen some issues w/Visual Studio itself when I added handlers to detected when a particular object was dropped on a web form in design view and didn't properly remove those handlers...but that's custom control development, I don't know if the same rules apply. You can try removing the handlers prior to disposing and see what you get. But I would think when the form disposes itself it removes all references to any handlers - but at the same time another object whose referencing an event maybe promoting the object to generation 2 in GC and keeping it from being de-referenced, I may be way over thinking this too and I'm no expert in GC; M.E. is pretty smart, there be something there for both of us to learn from...M.E.?
  13. Sorry. I don't know.
  14. That doesn't mean that it's referenced in your code behind. Again can you access it using the fully qualified namespace?
  15. Yes, the errors you got are expected...is there a reason why your just not DataBinding the DataGrid to a DataSet? Your really reinventing the wheel here.
  16. In each item is the DropDownList going to contain the same values for each row of the DataGrid or are you running a seperate query for each row in the DataGrid. If the second is true are you aware of the performance implications? If performance isn't a requirement I can help you from there, but I don't think this is the route your taking. If the first is true then you CAN use a DataSource. If the Query returns a cursor (a SELECT statement) then just populate a DataSet/DataTable and use that as your DataSource. I would need more specific information to help you further.
  17. Okay, if all the other forms are going to implement that property you need to use an interface who has that property. On each form you use that interface. Then your mOtherForm is of that interface type, not the form: Interface: Interface ICatsAccessible Property ProductID as Integer 'Prepend ReadOnly if needed End Interface Then on each FORM underneath the line 'Inherits ....' write: Implements ICatsAccessible and hit return, it will (should) implement the stubs for you. Then simple as I said before declare your member variable as: Dim mOtherForm as ICatsAccessible And then open your form as you normally do: mOtherForm = New MyForm1 'or whatever you're doing (as long as that objects implements the ICatsAccessible interface And finally you'll be able to compile with: mOtherForm.ProductId as the compiler will now that this variable is of a type that implements this interface.
  18. It appears your missing the reference to your custom control or need to add an 'using' statement to the top of your class in your web project. Can you access it via the fully qualified namespace?
  19. Do you have any errors? Will the web service throw an error if authentication isn't correct? Will the caller of the web service raise any errors you could see? Does the application or web service use any com components that might be using previous version that are loaded in memory? Is there a firewall setting blocking communications with the web service if it located on a different machine?
  20. Let's back up, what is ClsCats...is this the 'other form' or are we all incorrectly assuming? If it is indeed suppose to be an instance of ClsCats then just make your member field a type of ClsCats instead of Form, then you won't get your compile error. Also I notice that you never actually intialize ClsCats...or mention to us that it's being initialized in another procedure, I think we're all assuming this, but to clarify, you are intializing mOtherForm with a new instance of ClsCats somewhere right?
  21. John, One thing that you probably already have done, but worth checking...when you do your check do you do it as: If Object.Text Is Nothing OrElse IsDbNull(Object.Text) Then 'Handle condition End If 'Or is it: If Object.Text Is Nothing Or IsDbNull(Object.Text) Then 'Handle condition End If The Or and OrElse have very different behaviors, you probably already know this, but I wanted to check to see what you were using first (you should be using the top). I definitely don't understand why a control would return DBNull
  22. Well said, and I applogize to the thread starter for the derailment
  23. If you run the following in C# you will see that only the "Was Empty" is shown: if(this.textBox1.Text == null) MessageBox.Show("Was null"); if(this.textBox1.Text == String.Empty) MessageBox.Show("Was Empty"); this.textBox1.Text = null; if(this.textBox1.Text == null) MessageBox.Show("Was null"); if(this.textBox1.Text == String.Empty) MessageBox.Show("Was Empty"); I think your reasons for saying you can set a TextBox's Text property to null is because it allow you to pass it, but internally it say's it's still String.Empty, not null. Since VB treats String.Empty = Nothing (or is it Nothing = String.Empty? or both?) then I believe the similiar above in VB would show both message boxes before and after the click. I don't know CLR though so I'm admitedly making an educated guess on that. And thanks for the further detail of CType/DirectCast...I always forget that it does converting too, I soley use it as an equivelant to: MyNameObject mo = SingletonClass.GetObject() as MyNameObject The reason I shoot down VB6 functions is because they are VB6 functions. They are deprecated in my book even if not officially. Why? Well to give an example I work with a lot of RPG programmers. They have a few old dogs who are still using RPG 2 and 3, they currently for the most part do RPG 4 and are trying to move to ILE (and switch over to Java on new programs concurrently). Unfortunately IBM supports syntax all the way back to RPG 1. And it's really funny to watch these new programmer's complain about the code some old dog wrote in RPG 2 that could be done much cleaner in PRG Free Form. Then to watch these old dogs totally lost when trying to debug a program written in the 'newer' language (because they never learned RPG 3 or 4 or ILE because since it was always backwards compatable they never had to). See anything similiar? He can learn it now, or he can learn it later...the longer he takes to learn it, the worse off he'll be IMNSHO. Backwards compatiability on a DLL is great, on a language I think it's asking for trouble if it's any more than 1 generation...and that one generation that is backwards compatable should have everything marked as deprecated. Finally, I'm sorry but thinking of 'your' needs, and 'what works best for you' is a sure way to have something that isn't supportable and isn't maintainable in a corporate environment. Supportability and how easy it will be to make future enhancements by people who aren't familiar with the program have to be at the foremost of your mind (and yes documentation is a large part of that), and in a corporate envrionment you have about a 10% chance of supporting something you wrote. VB6 isn't taught in colleges around here, .NET and Java are...and they don't teach CType, CDbl, or CSng...so when these kids come in they maybe able to figure out what it means, but they're going to wonder why they're using it (kind of that whole RPG 2 thing)...go 5 years into the future and this could be a big problem. If your sole desire in life is to write your own personal programs as a hobby; do what you like...use GoTo Line 12 if the language supports it and poor some Ragu over that spagetti, but if you want to work in a corporate enviornment - IS or ISV then you need to lose that 'what works best for you' attitude real quick and follow the corporate standards. If your corporate standards are to use CSng and such...then go for it...but at my corp that's against the standards and I, on a personal level, agree with those standards. Sure, it does cause me to write extra code when working with arrays and a lot of other things when I'm doing VB.NET that I could be lazy and use old VB6 functions for, but then I don't mind because I know a Java or C# programmer can look at it and support it and modify it without have to figure out the VB6 specifics. This means when it comes to code reviews and technical design documents I don't get asked any questions, which means I get a out of meetings quicker, which means I'm a happier person.
  24. Server's don't push data to the client. Clients pull data from the server. The server will NEVER be able to directly push information to the client...this isn't the nature of HTTP; it is static. Your best bet is to have RPC poll the server from the client and if there is a change the call should return the changes....see AJAX or ATLAS on Google. Only poll as often as you think data will change. If data won't change under a 5 minute window, then don't poll less than every 5 minutes.
  25. First thing is first, if any function you call is the in the Microsoft.VisualBasic namespace do not use it, this includes: IsNull IsDbNull CInt CDbl CSng CLng CStr Redim Preserve Len UCase LCase Trim UBound LBound On Error Goto Resume The only exception is CType which works differently than VB6 CType, use this only when trying to cast an unknown object to a specific type, if it cannot cast it will return nothing. If you know the type of the object you should use DirectCast as it has better performance, but it will throw an InvalidCastException if it tries to cast to a type that the object isn't. You want to use System.DbNull.Value to test for null coming from a Database You want to use String.Empty for "", however "" is acceptable. If you want to see if an object is set you should: If Not myObject Is Nothing Then myObject.PerformAction() End If There are is another String function in .NET 2.0, but it is just encapsulating above methods into a single method (check for Empty or Null (Nothing)) As far as what to check in the control depends on the control type, if it's a TextBox then it will at minimum be String.Empty - a TextBox cannot have it's Text property set to Nothing. In fact most controls that your going to use coming from VB6 won't have a 'null' value if it's not filled in, it will either have String.Empty, -1, or 0 as values when not set depending on the control type.
×
×
  • Create New...