Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. What language was the dll written in? You can only add references to either a COM dll or a .Net assembly - any other dll you would need to access via p/invoke.
  2. dim s as string = "One, Two, Three" dim x() as string = s.Split(",") The above will return an array of strings - one element per value between the separator specified.
  3. Might be easier than using caspol.exe - if you have the security settings configured correctly on a single pc you can go into the .Net configuration tool and right click on the 'Runtime Security Policy' node. One option is 'Create Deployment Package' - this will allow you to generate a MSI file containing the policy. This can then be deployed via something like group policy to all the relevant machines.
  4. Are the printers all the same type? If so it might be easier to set them up as a printer pool under windows itself - that way you don't need to take responsibilty for managing this yourself.
  5. Dim ip As System.Net.IPAddress ip = System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList(0) should do the trick, if you have more than one ip address though you will need to loop through the AddressList to find them all.
  6. You need to set the command's connection to be your active connection. Something like ID3.Connection = Con3 should do the trick.
  7. I've never used but have heard good things about Code Auditor, there is a free trial so might be worth a look.
  8. You should be able to use the source file generated by the .Net 1.1 tool in a .Net 2 project without any modification - after all if you upgrade a project to .Net 2 it doesn't alter how you call a webservice. Regardless of the blocking / unblocking issue for a forms UI I do personally feel the loss of the .Net 1 methods is a shame - the event model is definately easier (and cleaner in most scenarios) but isn't that useful if you do not have a windows UI (a windows service or console app for example), need to co-ordinate multiple requests (wait handles are very useful here) and if you are using async web pages (this last one is interesting because VS does actually generate both the BeginXXX and EndXXX methods as well as the XXXAsync / Event pair when you add a web reference to a web application.
  9. Where is the ProcessOutPut method being called from?
  10. VS 2005 changed the deployment model for web applications - if you prefer the old style project based way then have a look at service pack 1 as this re-introduces the project based way of doing things.
  11. Where is the code you posted being called from? This error is generated if you try to update the UI from anything other than the main UI thread. Are you using any async callbacks or threads in your code? If so you will need to check if InvokeRequired is true and if so get the main UI thread to call your code - search these forums for InvokeRequired and you should get a few useful hits.
  12. Although I like the new behaviour I can't understand why they removed the BeginXXX / EndXXX methods. If you have the .net 1 sdk (or access to the .net 1 wsdl.exe) use that to generate the class and add it to your project. Bit of a hack but it works... Alternatively you could declare your own delegate that matches the web method's signature and call the delegate asynchronously.
  13. If it isn't working when called from a module it could be down to how you refer to the BackGroundWorker. In the line main.bgwrk_Download.ReportProgress(UBound(buffer) / httpRes.ContentLength * 100) where / how is main defined?
  14. http://www.xtremedotnettalk.com/showthread.php?t=83092 explains this with vb.net - the c# isn't too different though. http://www.xtremedotnettalk.com/showthread.php?t=97057 should also help with any conversion issues you might have.
  15. .Net 2 changed the workings of web applications in regards to compilation and publishing, the differences can really catch you out. If you prefer the VS 2003 way of doing things then SP1 for VS 2005 brings back the project based way of doing things as an option.
  16. Is the App_Code present on your local host?
  17. In that case a GUID might be a suitable datatype - statistically unique and can be auto generated either by SQL or .Net.
  18. .Net provides some built in localisation mechanisms for you. When developing web applications you can go to the tools menu and get VS to generate a resource file from a given page - this moves all strings, images etc. out of the HTML and stores them in a resx file. Further languages can be added by providing new resx files. Also rather than storing strings that you use programatically in the actual source you can also store these in resource files. At runtime .Net determines which language to use based on the installed languages of the browser making the request. I would recomenfd taking a look at this blog entry as it links to a couple of walkthroughs plus a way to store the resources in a database as an alternative to the built-in method.
  19. Rather than explicity calling the btnSaveTransaction_Click(objSender, e) method directly you might want to use the PerformClick on the btnSaveTransaction2 control. Also I notice you are creating a lot of controls in the code i.e. Dim ctlDateTimePicker As New DateTimePicker, ctlComboBox As New ComboBox, ctlTextBox As New TextBox Dim ctlCheckBox1 As New CheckBox, ctlCheckBox2 As New CheckBox if you are going to assign existing controls to these variables you do not need the New keyword - this will prevent you creating the unused instances of the controls and will keep the memory utilisation down. In the line Dim objSender As Object = DirectCast(Me.Controls("btnSaveTransaction2"), Object) the direct cast isn't required as everything is an object and therefore the cast is always safe and going to succeed. In the long run though it might be easier to have two separate methods - one to update the transactions table and one to update the transactions_weekly table and simply call the correct method(s) from the appropriate button click event.
  20. Is there meant to be a restriction on who can access which member's details or can any member access any other member's details? If there is some form of authorisation required then MrPauls' suggestion of implementing some form of security model is a must. If on the other hand anyone can access any member's details whatever you do will still require some form of information to be sent from the browser to the server and as such will be susceptible to exploits.
  21. In terms of naming schemes etc I try to follow The MS guidelines as best as possible, and use FxCop to check my conformance (this is actually part of some versions of VS 2005).
  22. If you have logging enabled on your IIS bog then you should be able to look in there to find the requested urls etc.
  23. If you go into the project properties and then select the resources tab simply remove it from there and it should work fine.
  24. Use stored procedures or parametrised queries. Basically avoid string concatenation in any of it's forms.
  25. Unless the stored procs have been encrypted the actual text should be visible in the syscomments table. You should be able to query it with something like SELECT OBJECT_NAME(id) FROM syscomments WHERE [text] LIKE '%TableName%' AND OBJECTPROPERTY(id, 'IsProcedure') = 1 GROUP BY OBJECT_NAME(id) if you are using sql2005 you could also use something like SELECT Name FROM sys.procedures WHERE OBJECT_DEFINITION(object_id) LIKE '%TableName%'
×
×
  • Create New...