Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. IIRC you need to set e.handled = true
  2. I suppose you could inherit from the Panel object and implement it that way - but why would you want to put an error provider in a statusbar? I thought the whole point was they indicated controls with errors by being next to the controls with errors.
  3. Datagrids expect the Datasource property to be .Net compatible source (DataSet, DataTable etc) Recordsets are accessed via COM interop as a backwards compatible measure - not really intended to be used with the .Net controls.
  4. try the following snippet and let me know if it helps. all I've done for the array is in the declaration section Dim names() As String = {"james", "steve", "dave", "fred"} and the following after the forms designer code Public Sub DoWork(ByVal nameIndex As Int32) 'Actually process the context menu selected End Sub Private Sub ContextMenu1_Popup(ByVal sender As Object, ByVal e As System.EventArgs) Handles CM1.Popup Dim intNumOfNames As Int32 = names.Length CM1.MenuItems.Clear() Dim m As String For Each m In names CM1.MenuItems.Add(m, AddressOf MenuHandler) Next End Sub Protected Sub MenuHandler(ByVal sender As Object, ByVal e As System.EventArgs) Dim m As MenuItem m = DirectCast(sender, MenuItem) DoWork(m.Index) End Sub
  5. the @ symbol prevents C# treating the \ as an escape character.
  6. What kind of differences are in the criteria between the fast and slow executions of the sp?
  7. Getting a good upgrade wizard would probably be too difficult in the long run. The number of things that have changed (normally for the better in .Net) couldn't be reliably converted (ADO, File Access, winsock) due to the different arcitecture under the framework. Also a lot of API calls are now redundant - these really should be converted to .Net calls as well. Collections / Arrays have changed, things like Queus and Stack are part of the framework now - should it also convert everybodies individual implementations of these to the framework? Inheritance adds new scope for reuse / and design, an upgrade wizard wouldn't really know how to refactor your code to take advantage. Personally I think a redesign of the application with .Net's capabilities in mind would ultimately give better performance AND an improved codebase. just my two pence worth...
  8. What is the definition for the Employee Type?
  9. What is the error you get and on what line of code?
  10. Too late and too much drink to look over all that (will promise to do so in the morning though) The 'Warning: Null value is eliminated by an aggregate or other SET operation' message you are getting basically means there are NULL values in one or more of the fields you are perfoming aggregate operations on (SUM, AVG, MIN, MAX etc) - this can throw the results of some operations (AVG for example)., not sure why that should affect a sum though? how are the tables related?
  11. strInput="123,testdata,testdata with a comma ,,last field" strInput=strInput.Replace(",,",",") 'New line here arrArray = strInput.Split(",")
  12. If yoou want to trap a key event in a form, you need to set the form's keypreview property to true.
  13. The KeyPress anly gives you the Key's character not hte underlying code. However if you use either the KeyUp or KeyDown events then the above code should work just fine.
  14. It is better to declare the parameters as the correct type rather than Object. Quite often the parameters were declared as any because the API could accept differrent things (string, integer, long etc) - but usually this was a pointer to the data in memory. In VB.Net simply declare the API multiple times, specifying the correct different versions of the API.
  15. I just tried a simple test app using your code and I changed the line Case name2 to Case name2.ToUpper and things worked.
  16. Create an Enum containing the options and make that the property type
  17. A bit rough and ready (no error trapping for example) - but should give you a rough idea Public Class Employee Public EmployeeName As String Public EmployeeID As Integer End Class Public Class EmployeeCollection Inherits CollectionBase Public Function Add(ByVal emp As Employee) As Integer Return InnerList.Add(emp) End Function Public Function Remove(ByVal emp As Employee) innerlist.Remove(emp) End Function Public Function RemoveRange(ByVal index As Integer, ByVal count As Integer) innerlist.RemoveRange(Index, Count) End Function Default Public Property Item(ByVal index As Integer) As Employee Get Return DirectCast(innerlist.Item(index), Employee) End Get Set(ByVal Value As Employee) innerlist.Item(index) = Value End Set End Property End Class
  18. Generally I would inherit from one of the Base classes under System.Collections. IIRC CollectionBase for collections or DictionaryBase for a name / value pair. It is a fairly simple matter to then provide your own type safe add / remove / item overloads that only deal with the class / interface you desire.
  19. Just a few other things. I notice you are opening a StreamReader in the first line of the FindName function - did you mean to? Also within the select case statement you have a lne that reads Case Name should that be Case Name1 instead? also you appear to be doing a binary search of the data - am I correct? If so is the data sorted? If so are the blank entries being moved to the start of the array rather than the end? finally are you modifying the numPosts variable anywhere else in the Form_Load?
  20. Do you have permissions to the share \\mylaptop\wwwroot$ ?
  21. should work just fine.
  22. Would only need to be installed on the server hosting the asp.net application
  23. If they are just using a web browser to access you asp.net apps then they shouldn't need anything extra installing. If the need to run a VB.Net application locally then they will need the .Net Framework installing (about 20M)
  24. to steal somebody else's code Try Shell("", AppWinStyle.NormalFocus, True) '// your code would go here '/// i made this to purposely throw an error '/// basically it tries to open something that doesnt exsist Catch ex as System.ArgumentException 'Use this here MsgBox("error: " & ex.Message) 'Also look at ex.ParamName End Try this also allows you to catch multiple different errors try 'Iffy code here catch ex as System.ArgumentException 'handle error here catch ex as System.InvalidCastException 'handle type mismatch end try hope that helps
×
×
  • Create New...