Jump to content
Xtreme .Net Talk

PlausiblyDamp

Administrators
  • Posts

    7016
  • Joined

  • Last visited

Everything posted by PlausiblyDamp

  1. You could store the time when they login in one variable and then on exit calculate the difference i.e. Dim d1 As DateTime = DateTime.Now 'do something in between Dim d2 As DateTime = DateTime.Now Dim ts As TimeSpan = d2.Subtract(d1) MessageBox.Show(ts.Hours.ToString & ":" & ts.Minutes.ToString) 'or MessageBox.Show(ts.TotalMinutes.ToString)
  2. Don't close the database connection until you have finished with the DataReader, DataReaders work in a connected fashion.
  3. Search these forums for more information on GC.Collect, but as a rule if you need to call it you are doing something wrong elsewhere. If you are disposing of things correctly you shouldn't need to call GC.Collect yourself.
  4. Possible options are either don't use frames or allow non secured users to see the contents of some frames i.e. if the top and left frames are company logo and navigation strip etc then these are unsecured but will only display minimum options until a user logs in.
  5. Page file usage just reflects the demands on the system's memory and it isn't down to a single application to control this. You would probably get better mileage trying to figure out why you application is using so many resources. If you are doing a lot of graphics drawing you are probably allocating lots of pens, brushs, graphics objects etc. make sure you are disposing of these things when they are finished with. You may want to have a look at CLR Profiler or similar tools to help identify where allocations are being made / leaks are happening
  6. Any chance you could show what code you have so far? Are you using the XmlSerializer class within the framework?
  7. The code you have posted will display any constraints on the DataSet, not on the database table. If you are using MS SQL then SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = 'PRIMARY KEY' AND TABLE_NAME = '</pre><table name here>' </ will return the name of the primary key for a given table.
  8. System.Data.OracleClient.dll - you need the full dll name.
  9. Could you not create a login for the windows account (or a group) that the users login as? Check the SQL help for information on sp_grantlogin
  10. Sorry - I meant what is the value for the SelectedValue?
  11. If you step through the code in the debugger what is the value of SelectedIndex when the error occurs?
  12. Could you not just create another login for the users rather than a new instance of MSDE?
  13. Most of the encryption routines just return byte arrays with each byte being the full range of 0 - 255. If you want to produce just text output (handy for cut & paste or e-mail) then Base64 encoding it could be a good idea. Clicky has a little example of how to do encryption / decryption using built in .Net classes but also encoding the results to a text based format.
  14. A Connection object has a BeginTransaction method - this returns a Transaction object; if you assign this to each command's Transaction property then they will all be part of the same transaction. Alternatively you may want to investigate Component Services under windows (System.EnterpriseServices.dll).
  15. System.Threading.Thread.CurrentThread.Sleep should allow an application to pause. However if you are doing this from server side ASP.Net then you may not get the expected results - it may be better if you tell us what you are trying to achieve and see if anyone knows a better way.
  16. In that case the easiest way is probably to either ask / offer a configuration section and store their selection somewhere. If the browser isn't configured correctly then you have no way of knowing their settings. This might just be possible if you used an ActiveX control on your web page - however this wouldn't work for any non-IE browser, non-windows platforms or if the user has quite sensibly decided to dis-allow ActiveX for security reasons.
  17. If you are dealing with SQL use the System.Data.SqlClient.SqlConnection object rather than an OleDBConnection object. The OleDb version will always require a provider the SqlClient version can only be used with SQL and therefore doesn't need a provider.
  18. You could always use Request.UserLanguages to see what languages the client supports. It should return an array of strings with position 0 being the default. Something like the following should work... Dim Language As String = Request.UserLanguages(0) If Not ((Language Is Nothing) OrElse (Language.IndexOf("-") < 0)) Then Dim ci As System.Globalization.CultureInfo = New System.Globalization.CultureInfo(Language) Dim CurrencySymbol As String = ci.NumberFormat.CurrencySymbol Label1.Text = CurrencySymbol End If you may want to loop through all provided languages to detect multiple currency characters - or at least loop till you find a valid one.
  19. Problem is windows 95 / 98 is now a fairly old OS - 98 is getting on for 6 / 7 years old and mainstream support has been dropped for both (see here) so a patch to provide additional functionality is unlikely - MS have always suggested going the NT route for Unicode due to the 9x lines poor / non-existant support for unicode. The is a sort of patch here but not a clue how this would work in relation to .Net.
  20. The Windows 9x product line has limited support for unicode strings both at the API level and in parts of the use interface. If your users really need to work with unicode then they will be much better off using an NT based OS (NT, Win2k, XP or Win2k3) where unicode is supported throughout. Failing that you will just have to cheat and avoid using labels - try and use a textbox or similar instead.
  21. http://www.xtremedotnettalk.com/showthread.php?t=83092 may be worth a read if you are new to using forms under .Net. Also if you wish to clos ethe startup form in your application while the app remains up and running then clicky may be worth a look.
  22. Dim s As String = "hello world" Dim sh As New System.Security.Cryptography.SHA512Managed Dim b() As Byte = System.Text.UnicodeEncoding.Unicode.GetBytes(s) b = sh.ComputeHash(b)
  23. The interface would be part of a fully qualified namespace - if two libraries both declared an interface with the same name then the namespace would be used to identify each anyway, they would not pass for each other. If both libraries tried to declare the same namespace and interface combination then you would not be able to reference both from your application. Easiest solution is to put common interface in a shared library (possibly along with any general code that acts upon the interface)
  24. The problem with changing a control's back colour is that if you do not consider my windows settings you could render your control un-usable. Imagine if you had decided on a blue background; what if I have decided on blue text - your control would render blue text on a blue background. The only solution would be to take control of all colours used in the application. This may work for you but consider people with impaired vision who have selected a high contrast scheme which enables them to see text properly, you are now providing a design that may be totally un-usable by these people. As to your argument of - to be honest I personally couldn't give a toss about the developers 'needs'; as a user of a piece of software I want it to fit my needs and I take a very dim view of software that igores / overrides my settings.
  25. Just having the same method names is not enough - if you wish to work with a method that requires an interface you must implement the exact same interface, not one that just looks the same.
×
×
  • Create New...