Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. Could you not use either the .SelectedItems or .SelectedIndices properties to get this?
  2. How are you and these other people starting your app? If they are running it from a shortcut then it could be setting the working directory to the My Documents folder. Rather than rely on relative paths try using the applications folder as a starting point.
  3. I did say 'for starters' ;)
  4. Asp.net doesn't work that way - there is no point making the server sleep for a while as that will just delay the page being sent to the client (which will then redirect immediately anyway). You would either need to use a Meta Refresh or possibly a bit of client side javascript.
  5. From a language point of view : Generics, Anonymous Delegates, Iterators, more classes in the framework. IDE: Integrated unit testing, integrated fxcop, integrated refactoring support, better intellisense, visualisers for debugging. Vastly improved web development: Master pages, new security controls, new navigation controls, personalisation, themes, better data base integration, vastly superior databinding capabilities, more flexible security model. Windows development: Menu strips, tool strips, improved data grid. Data Access: Datasets more useful, many dataset features now supported at the datatable level. For starters.
  6. VS 2003 supports and targets the .Net framework version 1.1 (and 1.0) - it will not however work with the version 2.0 of the framework. You will either need to find an alternate solution supported on v1 or move your project over to 2.0.
  7. Couldn't both listboxes have a selected item though? The UI will allow you to select an item in each listbox before clicking the button. If you want to see if an item is selected in a particular listbox just check to see if it's SelectedItem is nothing (or null if C#).
  8. That's right. Value types effectively are the data, Reference types are a pointer to the data. That's why reference types need to be initialised before use and value types do not.
  9. Value types (Structures) cannot be Nothing (null). Reference types (Classes) can. Net 2.0 introduces the concept of a Nullable type that may work in this scenario - however as a rule of thumb if there is a need to express it as a null / nothing value then use a class rather than a structure.
  10. Could you not place a literal control within the panel and then just assign the HTML to the literal's Text propery?
  11. Set it's format to custom and it's CustomFormat property to dd-MMM-yy
  12. You want to look at the classes in the System.IO namespace, specifically the FileStream and StreamWriter classes.
  13. You could just return the file contents as a byte array - the receiving application would then need to be responsible for saving it to disk.
  14. PlausiblyDamp

    .dll

    In your form load you need to change the line result = PicCountCard() to include the class name i.e. result = CPics.PicCountCard() you will also need to ensure the pics.dll is either in the same folder as the .exe or else somewhere within the systems path.
  15. Hashtables store objects and return objects. The result is you can store anything in it without regard to data type but it always returns an object. You will need to cast this returned object to the correct type to use it's properties. i.e. Dim h As New Hashtable h.Add("test", New Button) DirectCast(h("test"), Button).Text = "Test thing" System.Collections.Hashtable h = new Hashtable(); h.Add("Test", new Button()); ((Button) h["Test"]).Text="Test Thing";
  16. 1. That is by design, if you use an external library then you need to deploy it along with your executable. To minimise duplicates they can be installed in a central location known as the GAC (Global Assembly Cache) - however to do so the dll needs to have a strong name (been digitally signed). 2. Without knowing more about what your application does / interacts with it is difficult to pin-point exactly what causes any given error; however there are know incompatibilities between different versions of office.
  17. You also need to tell windows to use the form for processing any windows messages Public Module programme Public Sub main() Dim formulier As New Form1 formulier.Show() Application.Run(formulier) End Sub End Module should sort you out.
  18. In most cases you are probably better off building your own dialog to handle the specific input request and take full advantage of other controls (comboboxes, error providers etc.) rather than mimic the InputBox - which I always felt looked ugly and was severely limited in terms of how you could offer help to the user.
  19. Clicky mentions some possible tools for obfuscating your application - however as the same thread also discusses is it worth the time and trouble to do so?
  20. http://www.xtremedotnettalk.com/showthread.php?t=83092 might be worth a read to give yourself a better understanding of how forms work under .Net
  21. For the declare statements simply replace the longs with integers i.e. Public Declare Function PicCountCard Lib "Pics.dll" () As Integer Public Declare Sub PicOpenCard Lib "Pics.dll" (ByVal cardNbr As Integer) Public Declare Sub PicCardIsOpened Lib "Pics.dll" (ByVal cardNbr As Integer) Public Declare Sub PicCloseCard Lib "Pics.dll" (ByVal cardNbr As Integer) Public Declare Sub PicResetCard Lib "Pics.dll" (ByVal cardNbr As Integer) Public Declare Sub PicQueryCard Lib "Pics.dll" (ByVal cardNbr As Integer, ByRef nbrOfChannel As Byte, ByRef nbrOfStrobe As Byte, ByRef serialNumber As Integer)
  22. You may want to look at SQL's Data Transformation Services - you can find then in Enterprise Manager, they should be able to allow you to set this up and even automate it.
  23. something like settings = new AppSettingsReader(); string connString = (string) settings.GetValue("ConnectionString", typeof(string));
  24. something like Dim s As String s = "test string" s = s.PadLeft(25)
  25. You would probably better off using stored procedures or even parameterised queries rather than just concatenating strings together, as well as removing this problem it also protects you against certain forms of security exploits. Search these forums and you will find several examples of how to do them.
×
×
  • Create New...