Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. I would recommend putting the line Option Strict On at the top of your source file as it will highlight several potential problems and is good practice anyway. Firstly though I am not sure how the Select Case CInt(Console.ReadLine) line works if the user enters a r or b to the question as neither will convert to an integer anyway - just use case "r" and case "b" in the select statements. B.ToString will never evaluate to String.empty unless you deliberately override the ToString method - you would be better off checking if B.IsEmpty = true to decide based on how your code is currently organised. In your question you mention a fragment of code - If Not Object.Reference(B, Nothing) but this doesn't appear in your sample anywhere however an easier way to check would be If B Is Nothing Then this will never be true in your case as both rectangle and box are structures and as such can never be Nothing.
  2. The image map control is for web applications not windows applications.
  3. What ip addresses are contained in the code / config files? Can all these addresses be pinged from the web server? Are there any firewalls or similar between the web server / database etc and have these all had their rules correctly configured since the ip address problems?
  4. You would need to obtain a valid ssl certificate from the likes of verisign first. Once this has been obtained you will need to install the certificate on the server itself (double clicking it should launch the correct wizard), then run the IIS admin tool and navigate to the virtual directory for the web service, bring up the property pages and go to the 'Directory Security' tab. There should be a section on secure comunications with a button labelled Server certificate (or similar - I'm doing this from memory) - clickingthis will launch another wizard and you should have an option to assign an existing certificate so select that and chose the certificate you have just installed. IIRC that should do the trick.
  5. Could you not just use the IsNull function to handle changing the nulls to 0?
  6. What version of .Net are you using? IIRC the 1 / 1.1 versions pretty much only supported IE client side - the 2 and later versions though have much better browser support. Did you try copying the aspnet_client/system_web folder like the links suggested?
  7. that is pretty much how it is designed, classes marked with [DataContract] are really designed as a way of passing information between systems and as such aren't expected to include functionality. [OperationContract] defines server side functionality. If the object existed server side but still exposed all the properties every single property assignment would involve a network trip and also require the server to maintain the state between calls.
  8. Is ds.Tables(0) a DataTable or a myDataTable? If it is a plain DataTable then you cannot cast it to a myDataTable.
  9. Do the files need to physically exist on the disk at runtime? If they are not supposed to be changed then installing them into your application's folder would require admin rights on xp or higher to modify them, How large are these files? Fragmentation isn't likely to be an issue unless these are large files anyway. If you wanted to detect changes then you could calculate a hash of the files and store the hash in the exe - at runtime re-hash the files to see if they match.
  10. If you bring up the project's property page then there should be a resources tab - add the file in question in as an existing file. At runtime you will be able to access this via the resources object as a byte array (you could always open a memory stream over it if you need to use something like a binary reader etc.)
  11. I personally don't have too much of a problem with this - it makes your life easier as you do not have to create the object model yourself. If the database is still fairly changeable though then you could encounter a lot of problems as schemas change and the Linq to Sql model needs to be kept in sync. For anything more complex I would probably look at a more mature O/R mapper as this kind of problem is often addresses by the O/R mapper itself.
  12. Are you currently doing something that is experiencing performance issues or is this just something you are thinking about? The FileStream class itself is a buffered stream and as such you may not need to worry about buffering the data yourself. If you want to create the file and just add data to the file as you go then you might consider creating a Sparse File, although this option is only available on ntfs volumes.
  13. http://www.xtremedotnettalk.com/showthread.php?p=463520#post463520
  14. The N specifies the string that follows in single quotes is a unicode string rather than an ansi string. It sounds like the table in the data base has an Identity column - basically it just increments for every record inserted. The only other thing I would say is thet the example you posted is open to a potential security risk and you would be much better off using a parameterised query rather than relying on string concatenation.
  15. If you step through the code which line is throwing the error? On the line that errors what is the value of the cell in question?
  16. Which bits are / are not being exposed?
  17. When you step over the code - is it actually executing the lines mi_FontArial.Visible = visible; mi_FontCourier.Visible = visible; mi_RawView.Visible = false; If so what is the value of the variable visible at this point?
  18. If this is a routine of it's own you could just pass the relevant control in as a parameter.
  19. nah - we don't bother with credit or things here, just glad to have helped.
  20. DataReaders are generally less functional that some of the other techniques but have very low overheads and therefore can be faster, especially with large result sets.
  21. tpc.Value = Request.QueryString["domain"]; should do the job then.
  22. From your code it looks as though you aren't doing anything with the variable once you have read it from the query string. Does the stored proc have a parameter that will accept the domain? If not you might find it easier to use a datatable and a dataview rather than a datareader.
  23. Is the variable getting the correct value assigned to it (i.e. are you able to read the queystring correctly) or is the problem somewhere else?
  24. Are you using the .Net tab control or the old VB6 version?
  25. private void comboBox1_DragDrop(object sender, DragEventArgs e) { string[] names = (string[]) e.Data.GetData(DataFormats.FileDrop); comboBox1.Items.AddRange(names); } private void comboBox1_DragEnter(object sender, DragEventArgs e) { if(e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Copy; } Should give you the basic idea, the key is to handle the DragEnter and state what effect should be displayed, if this step is missed then the drop event will never be fired.
×
×
  • Create New...